pub struct AuthRateLimiter { /* private fields */ }Expand description
In-memory rate-limit table, sized by the number of distinct
source IPs that hit /auth/* in the last minute. For typical CLI
fleets this is small; entries older than two windows are pruned
on every check.
Constructed once by super::routes::build_router and threaded
through Axum’s Extension layer into rate_limit. The limit
(requests per IP per minute) is read from
super::ServerState::auth_rate_limit_per_minute on every
request, so it can change at config-reload time without
rebuilding the router.
Implementations§
Trait Implementations§
Source§impl Default for AuthRateLimiter
impl Default for AuthRateLimiter
Source§fn default() -> AuthRateLimiter
fn default() -> AuthRateLimiter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AuthRateLimiter
impl RefUnwindSafe for AuthRateLimiter
impl Send for AuthRateLimiter
impl Sync for AuthRateLimiter
impl Unpin for AuthRateLimiter
impl UnwindSafe for AuthRateLimiter
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.