pub struct SimpleUser {Show 15 fields
pub id: Uuid,
pub email: String,
pub password_hash: String,
pub is_active: bool,
pub is_locked: bool,
pub roles: Vec<String>,
pub two_factor_enabled: bool,
pub two_factor_methods: Vec<String>,
pub account_expires_at: Option<DateTime<Utc>>,
pub requires_password_change: bool,
pub last_login_at: Option<DateTime<Utc>>,
pub failed_login_attempts: u32,
pub locked_until: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Simple user struct for default authentication implementation
For production, modules should implement AuthenticatableUser trait
for their own domain User entity.
Fields§
§id: Uuid§email: String§password_hash: String§is_active: bool§is_locked: bool§roles: Vec<String>§two_factor_enabled: bool§two_factor_methods: Vec<String>§account_expires_at: Option<DateTime<Utc>>§requires_password_change: bool§last_login_at: Option<DateTime<Utc>>§failed_login_attempts: u32§locked_until: Option<DateTime<Utc>>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Trait Implementations§
Source§impl AuthenticatableUser for SimpleUser
impl AuthenticatableUser for SimpleUser
Source§fn password_hash(&self) -> &str
fn password_hash(&self) -> &str
Password hash for verification
Source§fn two_factor_enabled(&self) -> bool
fn two_factor_enabled(&self) -> bool
Whether 2FA is enabled
Source§fn two_factor_methods(&self) -> &[String]
fn two_factor_methods(&self) -> &[String]
2FA methods available to user
Source§fn requires_password_change(&self) -> bool
fn requires_password_change(&self) -> bool
Whether user must change password
Source§fn failed_login_attempts(&self) -> u32
fn failed_login_attempts(&self) -> u32
Number of failed login attempts
Source§impl Clone for SimpleUser
impl Clone for SimpleUser
Source§impl Debug for SimpleUser
impl Debug for SimpleUser
Source§impl<'de> Deserialize<'de> for SimpleUser
impl<'de> Deserialize<'de> for SimpleUser
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 SimpleUser
impl RefUnwindSafe for SimpleUser
impl Send for SimpleUser
impl Sync for SimpleUser
impl Unpin for SimpleUser
impl UnsafeUnpin for SimpleUser
impl UnwindSafe for SimpleUser
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