pub struct AuthContext {
pub user_id: String,
pub user: UserInfo,
pub roles: Vec<String>,
pub permissions: Vec<String>,
pub session_id: String,
pub token: Option<TokenInfo>,
pub provider: String,
pub authenticated_at: SystemTime,
pub expires_at: Option<SystemTime>,
pub metadata: HashMap<String, Value>,
}Expand description
Authentication context containing user information and session data
Fields§
§user_id: StringUser ID
user: UserInfoUser information
roles: Vec<String>User roles
permissions: Vec<String>User permissions
session_id: StringSession ID
token: Option<TokenInfo>Token information
provider: StringAuthentication provider used
authenticated_at: SystemTimeAuthentication timestamp
expires_at: Option<SystemTime>Token expiry time
metadata: HashMap<String, Value>Additional metadata
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<'de> Deserialize<'de> for AuthContext
impl<'de> Deserialize<'de> for AuthContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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