#[non_exhaustive]pub struct AuthConfig {
pub session_idle_timeout: Duration,
pub session_absolute_timeout: Duration,
pub remember_duration: Duration,
pub max_failures: i64,
pub max_failures_per_address: i64,
pub failure_window: Duration,
pub password_policy: PasswordPolicy,
}Expand description
Tunable auth policy. Loadable from a config section (all keys optional; an unset key keeps its default):
[auth]
session_idle_timeout_secs = 7200
session_absolute_timeout_secs = 43200
remember_duration_secs = 1209600
max_failures = 5
max_failures_per_address = 20
failure_window_secs = 900
[auth.password_policy]
min_length = 8Fields (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.session_idle_timeout: DurationHow long a session survives without a request. Activity past the halfway mark of this window pushes the deadline out again.
session_absolute_timeout: DurationThe ceiling a session cannot be renewed past, counted from login. Bounds
how long a stolen token stays useful however busy the thief keeps it.
session_ttl_secs is the former name of this key and still reads.
remember_duration: DurationHow long a “stay signed in” credential lasts. It survives the session ceiling: the point of it is to outlive the session and mint a new one.
max_failures: i64Failed attempts within failure_window, for one username from one
address, before that address is locked out of that username. Counted
per address so a stranger cannot lock an operator out from elsewhere.
max_failures_per_address: i64Failed attempts within failure_window from one address, whatever the
usernames, before that address is locked out of signing in at all.
failure_window: DurationThe window over which failed attempts are counted.
password_policy: PasswordPolicyWhat a new password must satisfy, wherever one is set.
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 AuthConfigwhere
AuthConfig: Default,
impl<'de> Deserialize<'de> for AuthConfigwhere
AuthConfig: Default,
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