pub struct LoginThrottle {
pub max_attempts: u32,
pub window_minutes: i64,
pub lock_minutes: i64,
}Expand description
Auto-throttle parameters for the login flow
(DESIGN_R2_ORGANISATIONAL.md §3.3 + §12 locked decisions).
All three knobs are exposed via RecoveryPolicy::login_throttle
so projects override the threshold without authoring a full trait
impl. The locked default matches DESIGN_R2_ORGANISATIONAL.md §12:
5 failed attempts within a 10-minute sliding window trigger a
15-minute soft lock. Soft locks do NOT revoke sessions
(Doctrine 22 + §13 locked-decision: only manual lock revokes).
Field semantics:
max_attempts— failure count that trips the soft lock when reached withinwindow_minutes. The counter is anchored onrustio_users.last_failed_login_at(R2 commit #1 schema) and logically resets when the window elapses.window_minutes— sliding window over whichmax_attemptsis measured. Failures older than this are ignored when evaluating the threshold.lock_minutes— duration of the soft lock written torustio_users.locked_untilwhen the threshold trips.
Setting max_attempts = 0 is valid and disables the auto-throttle
entirely (no failure ever trips a soft lock). Manual lock via
/admin/users/:id/lock (R2 commit #16) is independent of this
struct.
Fields§
§max_attempts: u32Failure threshold within window_minutes that trips a soft
lock. Default 5.
window_minutes: i64Sliding-window length, in minutes. Default 10.
lock_minutes: i64Soft-lock duration, in minutes. Default 15.
Implementations§
Source§impl LoginThrottle
impl LoginThrottle
Trait Implementations§
Source§impl Clone for LoginThrottle
impl Clone for LoginThrottle
Source§fn clone(&self) -> LoginThrottle
fn clone(&self) -> LoginThrottle
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 LoginThrottle
impl Debug for LoginThrottle
Source§impl Default for LoginThrottle
impl Default for LoginThrottle
Source§impl PartialEq for LoginThrottle
impl PartialEq for LoginThrottle
Source§fn eq(&self, other: &LoginThrottle) -> bool
fn eq(&self, other: &LoginThrottle) -> bool
self and other values to be equal, and is used by ==.impl Copy for LoginThrottle
impl Eq for LoginThrottle
impl StructuralPartialEq for LoginThrottle
Auto Trait Implementations§
impl Freeze for LoginThrottle
impl RefUnwindSafe for LoginThrottle
impl Send for LoginThrottle
impl Sync for LoginThrottle
impl Unpin for LoginThrottle
impl UnsafeUnpin for LoginThrottle
impl UnwindSafe for LoginThrottle
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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