pub struct AuthService { /* private fields */ }Expand description
Authentication service managing users and sessions.
Implementations§
Source§impl AuthService
impl AuthService
Sourcepub fn login(&self, username: &str, password: &str) -> AuthResponse
pub fn login(&self, username: &str, password: &str) -> AuthResponse
Authenticate user with username and password.
Sourcepub fn verify_mfa(&self, code: &str, temp_token: &str) -> AuthResponse
pub fn verify_mfa(&self, code: &str, temp_token: &str) -> AuthResponse
Verify MFA code and complete authentication.
Sourcepub fn validate_session(&self, token: &str) -> Option<UserInfo>
pub fn validate_session(&self, token: &str) -> Option<UserInfo>
Validate a session token and return user info.
Sourcepub fn list_users(&self) -> Vec<UserInfo>
pub fn list_users(&self) -> Vec<UserInfo>
List all users.
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Clean up expired sessions.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuthService
impl !RefUnwindSafe for AuthService
impl Send for AuthService
impl Sync for AuthService
impl Unpin for AuthService
impl UnwindSafe for AuthService
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