pub struct AuthSession {
pub id: String,
pub auth_state: Option<AuthState>,
pub tokens: Option<TokenSet>,
pub user_info: Option<UserInfo>,
pub provider: String,
pub created_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub last_activity: DateTime<Utc>,
pub vpn_session_id: Option<String>,
pub client_ip: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Authentication session
Fields§
§id: StringSession ID
auth_state: Option<AuthState>Authentication state (for OAuth2 flow)
tokens: Option<TokenSet>Token set (after successful authentication)
user_info: Option<UserInfo>User information
provider: StringProvider name
created_at: DateTime<Utc>Session creation time
expires_at: DateTime<Utc>Session expiration time
last_activity: DateTime<Utc>Last activity time
vpn_session_id: Option<String>Associated VPN session ID (if connected)
client_ip: Option<String>IP address of the client
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl AuthSession
impl AuthSession
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if session is expired
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if session is authenticated
Sourcepub fn needs_token_refresh(&self) -> bool
pub fn needs_token_refresh(&self) -> bool
Check if tokens need refresh
Sourcepub fn update_tokens(&mut self, tokens: TokenSet)
pub fn update_tokens(&mut self, tokens: TokenSet)
Update tokens
Sourcepub fn update_user_info(&mut self, user_info: UserInfo)
pub fn update_user_info(&mut self, user_info: UserInfo)
Update user info
Sourcepub fn complete_auth(&mut self, tokens: TokenSet, user_info: UserInfo)
pub fn complete_auth(&mut self, tokens: TokenSet, user_info: UserInfo)
Mark authentication complete
Sourcepub fn associate_vpn_session(&mut self, vpn_session_id: &str)
pub fn associate_vpn_session(&mut self, vpn_session_id: &str)
Associate with VPN session
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get user display name
Trait Implementations§
Source§impl Clone for AuthSession
impl Clone for AuthSession
Source§fn clone(&self) -> AuthSession
fn clone(&self) -> AuthSession
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 AuthSession
impl Debug for AuthSession
Source§impl<'de> Deserialize<'de> for AuthSession
impl<'de> Deserialize<'de> for AuthSession
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 AuthSession
impl RefUnwindSafe for AuthSession
impl Send for AuthSession
impl Sync for AuthSession
impl Unpin for AuthSession
impl UnwindSafe for AuthSession
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