pub struct AuthSettings {
pub jwt: JwtSettings,
pub argon2_memory_kib: Option<u32>,
pub argon2_iterations: Option<u32>,
pub argon2_parallelism: Option<u32>,
pub lockout_threshold: Option<u32>,
pub lockout_duration_secs: Option<u64>,
pub login_ip_limit: Option<u32>,
pub login_ip_window_secs: Option<u64>,
pub login_global_limit: Option<u32>,
pub login_global_window_secs: Option<u64>,
pub hash_wait_ms: Option<u64>,
pub login_field: Option<LoginField>,
}Expand description
Authentication: JWT lifetimes, password hashing cost and account lockout. Every default matches what the framework already did, so an upgrade changes nothing on its own.
Fields§
§jwt: JwtSettingsJWT lifetimes. User-wired: only
auth_routes::Config::with_jwt_settings reads it, which you call.
argon2_memory_kib: Option<u32>Argon2id memory cost in KiB. Default 19456, about 19 MiB,
which is the OWASP floor. Less memory means faster logins and
weaker resistance to brute force. Stay at or above 15 MiB.
argon2_iterations: Option<u32>Argon2id iteration count. Default 2, which OWASP pairs with
19456 KiB of memory.
argon2_parallelism: Option<u32>Argon2id lanes. Default 1. On a busy server one lane is
fastest overall, since extra lanes only move work between
cores.
lockout_threshold: Option<u32>Failed logins for one username, known or not, before it locks.
Default 5.
lockout_duration_secs: Option<u64>Lockout duration in seconds. Default 900 (15 min).
login_ip_limit: Option<u32>Failed logins one client IP (IPv6: one /64) may make per window.
Default 20.
login_ip_window_secs: Option<u64>Per-IP window in seconds. Default 60.
login_global_limit: Option<u32>Failed logins all clients together may make per window, for each
login (admin, operator console, each tenant). Default 600.
login_global_window_secs: Option<u64>Global window in seconds. Default 60.
hash_wait_ms: Option<u64>How long a login waits for a password-hashing slot before it
answers 503, in milliseconds. Default 5000.
login_field: Option<LoginField>What tenant users sign in with: "username" (default) or
"email" (needs the sso feature). Emails must be unique per tenant.
Trait Implementations§
Source§impl Clone for AuthSettings
impl Clone for AuthSettings
Source§impl Debug for AuthSettings
impl Debug for AuthSettings
Source§impl Default for AuthSettings
impl Default for AuthSettings
Source§impl<'de> Deserialize<'de> for AuthSettingswhere
AuthSettings: Default,
impl<'de> Deserialize<'de> for AuthSettingswhere
AuthSettings: 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>,
Source§impl PartialEq for AuthSettings
impl PartialEq for AuthSettings
impl StructuralPartialEq for AuthSettings
Auto Trait Implementations§
impl Freeze for AuthSettings
impl RefUnwindSafe for AuthSettings
impl Send for AuthSettings
impl Sync for AuthSettings
impl Unpin for AuthSettings
impl UnsafeUnpin for AuthSettings
impl UnwindSafe for AuthSettings
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