Expand description
Trait definitions for authentication system integration
This module provides generic traits for authentication. Modules can implement these traits with their own domain entities.
§Generic Design
Instead of hardcoded entity structs, this module uses traits:
AuthenticatableUser- Trait for user entities that can be authenticatedUserRepository- Generic repository trait for user operations
§Usage
ⓘ
// Module implements trait for its domain User entity
impl AuthenticatableUser for MyUser {
fn id(&self) -> &Uuid { &self.id }
fn email(&self) -> &str { &self.email }
fn password_hash(&self) -> &str { &self.password_hash }
// ... other methods
}Structs§
- Auth
Context - Authentication context for enhanced security
- Auth
Request - Enhanced authentication request
- Auth
Result Enhanced - Enhanced authentication result with security info
- Device
Info - Device information for security tracking
- Password
Policy - Password strength requirements
- Password
Reset Confirmation - Password reset confirmation
- Password
Reset Request - Password reset request
- Refresh
Token Claims - Refresh token claims for token refresh functionality
- Security
Flags - Security flags for authentication result
- Simple
User - Simple user struct for default authentication implementation
- TwoFactor
Challenge - Two-factor authentication challenge
Enums§
- Security
Alert Type - Security alert types
- TwoFactor
Method - Two-factor authentication methods
Traits§
- Authenticatable
User - Trait for user entities that can be authenticated
- Security
Service - Security service trait for authentication security features
- User
Repository - Generic user repository trait for database operations
Type Aliases§
- User
- Type alias for backwards compatibility