Skip to main content

AuthApi

Struct AuthApi 

Source
pub struct AuthApi;
Expand description

AuthApi

Owns delegated-token helpers and root-signed role-attestation helpers.

Implementations§

Source§

impl AuthApi

Source

pub fn set_delegated_session_subject( delegated_subject: Principal, bootstrap_token: DelegatedToken, requested_ttl_secs: Option<u64>, ) -> Result<(), Error>

Persist a temporary delegated session subject for the caller wallet.

Source

pub fn clear_delegated_session()

Remove the caller’s delegated session subject.

Source

pub fn delegated_session_subject() -> Option<Principal>

Read the caller’s active delegated session subject, if configured.

Source

pub fn prune_expired_delegated_sessions() -> usize

Prune all currently expired delegated sessions.

Source§

impl AuthApi

Source

pub fn prepare_delegated_token( request: DelegatedTokenPrepareRequest, ) -> Result<DelegatedTokenPrepareResponse, Error>

Prepare a delegated token from the issuer-local active delegation proof.

Source

pub fn get_delegated_token( request: DelegatedTokenGetRequest, ) -> Result<DelegatedToken, Error>

Retrieve a prepared delegated token with its issuer canister-signature proof.

Source

pub fn install_active_delegation_proof( request: InstallActiveDelegationProofRequest, ) -> Result<InstallActiveDelegationProofResponse, Error>

Install validated root-certified delegation material for issuer-local token issuance.

Source

pub async fn prepare_delegation_proof( request: DelegationProofIssueRequest, ) -> Result<DelegationProofPrepareResponse, Error>

Prepare a root delegation proof from root over RPC.

Source

pub fn prepare_delegation_proof_root( request: DelegationProofIssueRequest, ) -> Result<DelegationProofPrepareResponse, Error>

Prepare a root-certified delegation proof from the local root update path.

Source

pub fn get_delegation_proof_root( request: DelegationProofGetRequest, ) -> Result<DelegationProof, Error>

Retrieve a prepared self-contained delegation proof from the local root query path.

Source

pub fn prepare_role_attestation_root( request: RoleAttestationRequest, ) -> Result<RoleAttestationPrepareResponse, Error>

Prepare a root-certified role attestation from the local root update path.

Source

pub fn get_role_attestation_root( request: RoleAttestationGetRequest, ) -> Result<SignedRoleAttestation, Error>

Retrieve a prepared role attestation with its root canister-signature proof.

Source

pub async fn verify_role_attestation( attestation: &SignedRoleAttestation, min_accepted_epoch: u64, ) -> Result<(), Error>

Verify a role attestation locally from its embedded root proof.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.