pub struct AuthContext {
pub subject: String,
pub issuer: String,
pub key_class: KeyClass,
pub metering_key: String,
pub deployment_id: Option<String>,
pub expires_at: u64,
pub scope: String,
pub limits: Limits,
pub plan: Option<String>,
pub origin: Option<String>,
pub client_ip: Option<String>,
pub jti: String,
}Expand description
Auth context extracted from a verified token
Fields§
§subject: StringSubject identifier
issuer: StringIssuer
key_class: KeyClassKey class (secret vs publishable)
metering_key: StringMetering key for usage attribution
deployment_id: Option<String>Deployment ID binding
expires_at: u64Token expiration time
scope: StringGranted scope
limits: LimitsResource limits
plan: Option<String>Plan or access tier associated with the session
origin: Option<String>Origin binding
client_ip: Option<String>Client IP binding
jti: StringJWT ID
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn from_claims(claims: SessionClaims) -> Self
pub fn from_claims(claims: SessionClaims) -> Self
Create AuthContext from verified claims
Trait Implementations§
Source§impl Clone for AuthContext
impl Clone for AuthContext
Source§fn clone(&self) -> AuthContext
fn clone(&self) -> AuthContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthContext
impl RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin for AuthContext
impl UnsafeUnpin for AuthContext
impl UnwindSafe for AuthContext
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