pub struct SignInThrottle { /* private fields */ }Expand description
Failed password sign-ins per username and per client address
(TEAMCRAFT_SIGNIN_MAX_FAILURES within SIGN_IN_WINDOW); once a
counter is full, sign-in for that name or address is refused with 429
until the window has passed – without checking the password. Counted in
memory per server process; a successful sign-in clears the username’s
counter, not the address’s (else an attacker with an account of their
own could reset it between guesses).
Implementations§
Source§impl SignInThrottle
impl SignInThrottle
Sourcepub fn new(max_failures: u32, window: Duration) -> SignInThrottle
pub fn new(max_failures: u32, window: Duration) -> SignInThrottle
max_failures 0 turns the throttle off.
Sourcepub fn keys(username: &str, client: Option<IpAddr>) -> Vec<String>
pub fn keys(username: &str, client: Option<IpAddr>) -> Vec<String>
The counters a sign-in attempt touches.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SignInThrottle
impl RefUnwindSafe for SignInThrottle
impl Send for SignInThrottle
impl Sync for SignInThrottle
impl Unpin for SignInThrottle
impl UnsafeUnpin for SignInThrottle
impl UnwindSafe for SignInThrottle
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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 moreimpl<T> Parallelizable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.