#[non_exhaustive]pub struct AuthConfig {
pub enabled: bool,
pub username: String,
pub password_hash: String,
pub session_timeout: Duration,
pub max_failed_attempts: u32,
pub lockout_duration: Duration,
}Expand description
Authentication configuration for the web dashboard.
Controls authentication behavior including credentials, session management, and security policies like rate limiting and account lockout.
Debug never shows password_hash.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolWhether authentication is enabled
username: StringUsername for basic authentication
password_hash: StringBcrypt hash of the password. It is only ever verified with bcrypt (the auth
feature), never compared to the password as text.
session_timeout: DurationUpper bound on how long a successful credential check is remembered (at most
60 seconds, the VERIFIED_CREDENTIALS_TTL of the auth module); zero re-verifies every request.
max_failed_attempts: u32Failed attempts from one client address before it is locked out
lockout_duration: DurationHow long a locked-out client is refused. A failure older than this no longer counts.
Implementations§
Source§impl AuthConfig
impl AuthConfig
Sourcepub fn with_enabled(self, value: bool) -> Self
pub fn with_enabled(self, value: bool) -> Self
Sets enabled.
Sourcepub fn with_username(self, value: String) -> Self
pub fn with_username(self, value: String) -> Self
Sets username.
Sourcepub fn with_password_hash(self, value: String) -> Self
pub fn with_password_hash(self, value: String) -> Self
Sets password_hash.
Sourcepub fn with_session_timeout(self, value: Duration) -> Self
pub fn with_session_timeout(self, value: Duration) -> Self
Sets session_timeout.
Sourcepub fn with_max_failed_attempts(self, value: u32) -> Self
pub fn with_max_failed_attempts(self, value: u32) -> Self
Sets max_failed_attempts.
Sourcepub fn with_lockout_duration(self, value: Duration) -> Self
pub fn with_lockout_duration(self, value: Duration) -> Self
Sets lockout_duration.
Source§impl AuthConfig
impl AuthConfig
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§impl Debug for AuthConfig
impl Debug for AuthConfig
Source§impl Default for AuthConfig
impl Default for AuthConfig
Source§impl<'de> Deserialize<'de> for AuthConfig
impl<'de> Deserialize<'de> for AuthConfig
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>,
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more