pub struct AuthContext {
pub subject: Option<String>,
pub scopes: Vec<String>,
pub token: Option<AccessToken>,
pub claims: Option<Value>,
}Expand description
Authentication context stored for a request/session.
Fields§
§subject: Option<String>Subject identifier (user or client ID).
scopes: Vec<String>Authorized scopes for this subject.
token: Option<AccessToken>Access token (if available).
claims: Option<Value>Optional raw claims (transport or provider specific).
Implementations§
Source§impl AuthContext
impl AuthContext
Sourcepub fn anonymous() -> AuthContext
pub fn anonymous() -> AuthContext
Creates an anonymous context (no subject, no scopes).
Sourcepub fn with_subject(subject: impl Into<String>) -> AuthContext
pub fn with_subject(subject: impl Into<String>) -> AuthContext
Creates a context with a subject identifier.
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 moreSource§impl Debug for AuthContext
impl Debug for AuthContext
Source§impl Default for AuthContext
impl Default for AuthContext
Source§fn default() -> AuthContext
fn default() -> AuthContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AuthContext
impl<'de> Deserialize<'de> for AuthContext
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AuthContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AuthContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AuthContext
impl Serialize for AuthContext
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for AuthContext
impl RefUnwindSafe for AuthContext
impl Send for AuthContext
impl Sync for AuthContext
impl Unpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).