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>,
}Expand description
Authentication knobs (#87) — JWT lifetimes, password hashing cost, account lockout policy. Each field has a sensible default matching the framework’s hardcoded values, so existing deployments don’t behave differently after upgrading.
Fields§
§jwt: JwtSettingsJWT-related lifetimes + behavior. Mirrors
rustango::tenancy::auth_routes::Config field names so a
Settings-driven project can hand the section straight to
auth_routes::jwt_router(...).
argon2_memory_kib: Option<u32>Argon2id memory cost (KiB). Default 19456 (~19 MiB) — the
OWASP-recommended floor for password hashing as of 2024.
Lower values speed up login at the cost of brute-force
resistance. Keep ≥ 15 MiB in prod.
argon2_iterations: Option<u32>Argon2id iteration count. Default 2. OWASP recommends
≥ 2 paired with ≥ 19456 KiB memory.
argon2_parallelism: Option<u32>Argon2id parallelism (lanes). Default 1 — single-threaded
hashing is fastest on a busy server because parallel hashing
just trades one core’s bandwidth for another’s.
lockout_threshold: Option<u32>Failed-login attempts before lockout. Default 5.
lockout_duration_secs: Option<u64>Lockout duration in seconds. Default 900 (15 min).
Trait Implementations§
Source§impl Clone for AuthSettings
impl Clone for AuthSettings
Source§fn clone(&self) -> AuthSettings
fn clone(&self) -> AuthSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuthSettings
impl Debug for AuthSettings
Source§impl Default for AuthSettings
impl Default for AuthSettings
Source§fn default() -> AuthSettings
fn default() -> 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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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