pub struct AuthRateLimitConfig {
pub enabled: bool,
pub max_requests: u32,
pub window_secs: u64,
}Expand description
Rate limit configuration for authentication endpoints (sliding-window algorithm).
Uses a per-key sliding-window counter for brute-force protection on authentication endpoints (login, token refresh, callback).
Distinct from fraiseql_server::middleware::RateLimitConfig, which uses
a token-bucket algorithm for general request rate limiting.
Fields§
§enabled: boolWhether rate limiting is enabled for this endpoint
max_requests: u32Maximum number of requests allowed in the window
window_secs: u64Window duration in seconds
Implementations§
Source§impl AuthRateLimitConfig
impl AuthRateLimitConfig
Sourcepub const fn per_ip_standard() -> Self
pub const fn per_ip_standard() -> Self
IP-based rate limiting for public endpoints 100 requests per 60 seconds (typical for auth/start, auth/callback)
Sourcepub const fn per_ip_strict() -> Self
pub const fn per_ip_strict() -> Self
Stricter IP-based rate limiting for sensitive endpoints 50 requests per 60 seconds
Sourcepub const fn per_user_standard() -> Self
pub const fn per_user_standard() -> Self
User-based rate limiting for authenticated endpoints 10 requests per 60 seconds
Sourcepub const fn failed_login_attempts() -> Self
pub const fn failed_login_attempts() -> Self
Failed login attempt limiting 5 failed attempts per 3600 seconds (1 hour)
Trait Implementations§
Source§impl Clone for AuthRateLimitConfig
impl Clone for AuthRateLimitConfig
Source§fn clone(&self) -> AuthRateLimitConfig
fn clone(&self) -> AuthRateLimitConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AuthRateLimitConfig
impl RefUnwindSafe for AuthRateLimitConfig
impl Send for AuthRateLimitConfig
impl Sync for AuthRateLimitConfig
impl Unpin for AuthRateLimitConfig
impl UnsafeUnpin for AuthRateLimitConfig
impl UnwindSafe for AuthRateLimitConfig
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