pub struct AuthService { /* private fields */ }Expand description
Authentication service
Implementations§
Source§impl AuthService
impl AuthService
pub fn new(config: AuthServiceConfig) -> Result<Self>
Sourcepub fn with_secret(jwt_secret: &str) -> Self
pub fn with_secret(jwt_secret: &str) -> Self
Create an AuthService with HS256 and the given secret (infallible).
Sourcepub async fn authenticate_enhanced(
&self,
request: AuthRequest,
user_repository: &dyn UserRepository,
security_service: &dyn SecurityService,
) -> Result<AuthResultEnhanced>
pub async fn authenticate_enhanced( &self, request: AuthRequest, user_repository: &dyn UserRepository, security_service: &dyn SecurityService, ) -> Result<AuthResultEnhanced>
Authenticate user with enhanced security.
Orchestrates: validation, rate-limiting, credential verification, security analysis, token generation, and audit logging.
Sourcepub async fn generate_token(&self, user_id: &Uuid) -> Result<String>
pub async fn generate_token(&self, user_id: &Uuid) -> Result<String>
Generate JWT token
Sourcepub async fn validate_token(&self, token: &str) -> Result<TokenValidation>
pub async fn validate_token(&self, token: &str) -> Result<TokenValidation>
Validate JWT token
Auto Trait Implementations§
impl !Freeze for AuthService
impl RefUnwindSafe for AuthService
impl Send for AuthService
impl Sync for AuthService
impl Unpin for AuthService
impl UnsafeUnpin 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