pub struct RateLimiters {
pub auth_start: KeyedRateLimiter,
pub auth_callback: KeyedRateLimiter,
pub auth_refresh: KeyedRateLimiter,
pub auth_logout: KeyedRateLimiter,
pub failed_logins: KeyedRateLimiter,
}Expand description
Global rate limiters for different endpoints
Fields§
§auth_start: KeyedRateLimiterauth/start: per-IP, 100 req/min
auth_callback: KeyedRateLimiterauth/callback: per-IP, 50 req/min
auth_refresh: KeyedRateLimiterauth/refresh: per-user, 10 req/min
auth_logout: KeyedRateLimiterauth/logout: per-user, 20 req/min
failed_logins: KeyedRateLimiterFailed login tracking: per-user, 5 attempts/hour
Implementations§
Source§impl RateLimiters
impl RateLimiters
Sourcepub fn with_configs(
start_cfg: AuthRateLimitConfig,
callback_cfg: AuthRateLimitConfig,
refresh_cfg: AuthRateLimitConfig,
logout_cfg: AuthRateLimitConfig,
failed_cfg: AuthRateLimitConfig,
) -> Self
pub fn with_configs( start_cfg: AuthRateLimitConfig, callback_cfg: AuthRateLimitConfig, refresh_cfg: AuthRateLimitConfig, logout_cfg: AuthRateLimitConfig, failed_cfg: AuthRateLimitConfig, ) -> Self
Create with custom configurations
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RateLimiters
impl !RefUnwindSafe for RateLimiters
impl Send for RateLimiters
impl Sync for RateLimiters
impl Unpin for RateLimiters
impl UnsafeUnpin for RateLimiters
impl !UnwindSafe for RateLimiters
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
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>
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 more