pub struct AuthClaims {
pub did: String,
pub role: Role,
pub session_id: String,
pub session_pubkey_b58btc: Option<String>,
pub amr: Vec<String>,
pub acr: String,
}Expand description
Extracted from a valid JWT Bearer token on protected routes.
Add this as a handler parameter to require authentication:
ⓘ
async fn handler(_auth: AuthClaims, ...) { }Fields§
§did: String§role: Role§session_id: StringThe session this token belongs to. Used by step-up to elevate the same session in place. Empty for transports without a session record (e.g. per-message DIDComm auth).
session_pubkey_b58btc: Option<String>Ephemeral session pubkey if one was registered during login —
Ed25519 multikey, base58btc-encoded with the z prefix.
dispatch_trust_task uses this to verify a Data Integrity proof’s
verificationMethod came from the same session that issued the
JWT.
amr: Vec<String>Authentication methods on the session’s token (["did"] base,
plus "webauthn"/"vta" after a step-up).
acr: StringAssurance level on the session’s token ("aal1" base, "aal2"
after a step-up). Gated by StepUpAuth.
Trait Implementations§
Source§impl Clone for AuthClaims
impl Clone for AuthClaims
Source§fn clone(&self) -> AuthClaims
fn clone(&self) -> AuthClaims
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthClaims
impl Debug for AuthClaims
Source§impl<S> FromRequestParts<S> for AuthClaimswhere
S: AuthState,
impl<S> FromRequestParts<S> for AuthClaimswhere
S: AuthState,
Source§type Rejection = AppError
type Rejection = AppError
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
state: &S,
) -> Result<AuthClaims, <AuthClaims as FromRequestParts<S>>::Rejection>
async fn from_request_parts( parts: &mut Parts, state: &S, ) -> Result<AuthClaims, <AuthClaims as FromRequestParts<S>>::Rejection>
Perform the extraction.
Auto Trait Implementations§
impl Freeze for AuthClaims
impl RefUnwindSafe for AuthClaims
impl Send for AuthClaims
impl Sync for AuthClaims
impl Unpin for AuthClaims
impl UnsafeUnpin for AuthClaims
impl UnwindSafe for AuthClaims
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.