pub struct DefaultPasswordPolicy {
pub min_len: usize,
}Expand description
Length-only password policy. Default min_len is 10 — the
secure-by-default baseline R1 ships with: long enough to defeat
trivial guessing under Argon2id + per-IP rate-limiting (NIST SP
800-63B’s recommended length floor is 8, with longer being
preferable), short enough not to drive operators toward sticky-
note workarounds. Production / regulated deployments are
encouraged to override to 12+ via
crate::admin::Admin::password_policy; high-sensitivity
deployments may want 16+ paired with an organisational
complexity rule or breach blocklist.
The framework deliberately ships no complexity-class rules
(“must contain a symbol”, “must include uppercase”) in the
default — they demonstrably push humans toward predictable
patterns without improving entropy meaningfully (NIST SP
800-63B Appendix A). Projects that need them implement a
custom PasswordPolicy.
Fields§
§min_len: usizeImplementations§
Source§impl DefaultPasswordPolicy
impl DefaultPasswordPolicy
Sourcepub const fn with_min_len(min_len: usize) -> Self
pub const fn with_min_len(min_len: usize) -> Self
New policy with an explicit floor. Useful for projects that
want a stronger length baseline without authoring a full
PasswordPolicy impl.
Trait Implementations§
Source§impl Clone for DefaultPasswordPolicy
impl Clone for DefaultPasswordPolicy
Source§fn clone(&self) -> DefaultPasswordPolicy
fn clone(&self) -> DefaultPasswordPolicy
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 DefaultPasswordPolicy
impl Debug for DefaultPasswordPolicy
Source§impl Default for DefaultPasswordPolicy
impl Default for DefaultPasswordPolicy
impl Copy for DefaultPasswordPolicy
Auto Trait Implementations§
impl Freeze for DefaultPasswordPolicy
impl RefUnwindSafe for DefaultPasswordPolicy
impl Send for DefaultPasswordPolicy
impl Sync for DefaultPasswordPolicy
impl Unpin for DefaultPasswordPolicy
impl UnsafeUnpin for DefaultPasswordPolicy
impl UnwindSafe for DefaultPasswordPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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