pub enum AuditEvent {
AuthAttemptStarted {
email: String,
ip_address: Option<String>,
},
AuthSuccess {
user_id: String,
ip_address: Option<String>,
risk_score: Option<f32>,
},
AuthFailure {
email: String,
reason: String,
ip_address: Option<String>,
},
TokenGenerated {
user_id: String,
token_type: String,
},
TokenValidated {
user_id: String,
},
TokenValidationFailed {
reason: String,
},
PasswordHashed,
PasswordVerified {
success: bool,
},
PasswordValidationFailed {
reason: String,
},
AccountStatusChecked {
user_id: String,
is_active: bool,
is_locked: bool,
},
TwoFactorRequired {
user_id: String,
},
NewDeviceDetected {
user_id: String,
},
}Expand description
Structured security audit events emitted by the auth system
Variants§
AuthAttemptStarted
Authentication attempt started
AuthSuccess
Authentication succeeded
AuthFailure
Authentication failed
TokenGenerated
Token generated
TokenValidated
Token validated successfully
TokenValidationFailed
Token validation failed
PasswordHashed
Password hashed (no sensitive data included)
PasswordVerified
Password verification completed
PasswordValidationFailed
Password validation failed requirements
AccountStatusChecked
Account status checked during auth flow
TwoFactorRequired
Two-factor authentication required
NewDeviceDetected
New device detected during login
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Get a human-readable description of the event
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§impl Debug for AuditEvent
impl Debug for AuditEvent
Auto Trait Implementations§
impl Freeze for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEvent
impl UnwindSafe for AuditEvent
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