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 async fn local_shard_public_key_sec1() -> Result<Vec<u8>, Error>

Resolve the local shard public key in SEC1 encoding.

Source

pub async fn issue_token( request: DelegatedTokenIssueRequest, ) -> Result<DelegatedToken, Error>

Issue a delegated token from an explicit self-contained proof.

Source

pub async fn mint_token( request: DelegatedTokenMintRequest, ) -> Result<DelegatedToken, Error>

Request a root proof, then issue a self-contained delegated token.

Source

pub async fn request_delegation( request: DelegationProofIssueRequest, ) -> Result<DelegationProof, Error>

Request a self-contained delegation proof from root over RPC.

Source

pub async fn issue_delegation_proof( request: DelegationProofIssueRequest, ) -> Result<DelegationProof, Error>

Issue a self-contained delegation proof from the local root.

Source

pub async fn request_role_attestation( request: RoleAttestationRequest, ) -> Result<SignedRoleAttestation, Error>

Request a signed role attestation from root over RPC.

Source

pub async fn attestation_key_set() -> Result<AttestationKeySet, Error>

Return the current root role-attestation key set.

Source

pub async fn publish_root_auth_material() -> Result<(), Error>

Publish root auth material into subnet state and warm root-owned keys once.

Source

pub fn replace_attestation_key_set(key_set: AttestationKeySet)

Replace the verifier-local role-attestation key set.

Source

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

Verify a role attestation, refreshing root keys once on unknown key.

Source§

impl AuthApi

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.