Skip to main content

DidHostingServerAuthBackend

Struct DidHostingServerAuthBackend 

Source
pub struct DidHostingServerAuthBackend { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl AuthBackend for DidHostingServerAuthBackend

Source§

type Store = DidHostingSessionStore

Session storage adapter.
Source§

type Error = AppError

Backend-local error type. Must convert from AuthError so the canonical handler can raise auth-specific failures. Must implement IntoResponse at the route boundary; the trait does not bound that here (would force an axum dependency on every backend), but the canonical handler surfaces the error verbatim and the route layer renders it via its existing path.
Source§

type Role = Role

Backend’s role type. The handler holds it opaquely between ACL lookup and JWT minting. Read more
Source§

fn sessions(&self) -> &Self::Store

Session store handle. The handler invokes the SessionStore methods through this.
Source§

fn mint_access_token<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'life7, 'async_trait>( &'life0 self, subject: &'life1 str, session_id: &'life2 str, role: &'life3 Self::Role, _contexts: &'life4 [String], amr: &'life5 [String], acr: &'life6 str, _tee_attested: bool, ttl_secs: u64, jti: &'life7 str, ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait, 'life6: 'async_trait, 'life7: 'async_trait,

Mint an access token JWT for an authenticated session. Read more
Source§

fn check_acl<'life0, 'life1, 'async_trait>( &'life0 self, did: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<RoleResolution<Self::Role>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a DID to a role + context scope. Returning an error (typically AuthError::Forbidden) rejects the request before any other gate fires.
Source§

fn challenge_ttl(&self) -> u64

Challenge TTL in seconds. Typical: 60.
Source§

fn access_token_ttl(&self) -> u64

Access-token TTL in seconds. Typical: 900 (15 min).
Source§

fn refresh_token_ttl(&self) -> u64

Refresh-token TTL in seconds. Typical: 86400 (24 h).
Source§

fn validate_did<'life0, 'life1, 'async_trait>( &'life0 self, _did: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Optional DID-method validation gate. Default: accept any method (backends with no allowlist). VTA overrides in TEE mode to enforce allowed_did_methods.
Source§

fn attest_challenge<'life0, 'life1, 'async_trait>( &'life0 self, _challenge_bytes: &'life1 [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<AttestationOutcome, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Optional TEE attestation hook. Returns the attestation report (if produced) and whether attestation succeeded. Default: no attestation (None, false). VTA overrides in TEE mode; in TeeMode::Required a failure here must be raised as AuthError::AttestationFailed.
Source§

fn max_pending_challenges_per_did(&self) -> usize

Cap on concurrent ChallengeSent sessions per DID. Default 10. Setting to 0 disables per-DID rate limiting (still IP-rate-limited at the tower-governor layer). Backends with low-trust callers may want this higher; backends with admin-only callers can keep it at 10.
Source§

fn audit(&self, event: AuthAuditEvent<'_>)

Audit hook fired at the end of each handler. Default impl emits via tracing::info!(audit=true); backends with structured audit pipelines (e.g. VTC’s audit log with HMAC actor hashing) can override.
Source§

fn access_token_ttl_for_aal2(&self) -> u64

Access-token TTL in seconds for a stepped-up (acr=aal2) session. Default: 1/3 of Self::access_token_ttl floored to a minimum of 60 seconds — closes M2 from the May 2026 security review, which observed that a leaked aal2 token has the same 15-minute window as a aal1 token despite the elevated privileges it grants. Read more
Source§

fn didcomm_freshness_window(&self) -> u64

DIDComm created_time freshness window in seconds. The canonical handler rejects messages older than this against session.created_at to bound replay risk. Default 60s.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more