pub struct RateLimitConfig {
pub enable_rate_limiting: bool,
pub rate_limit: u32,
pub rate_limit_window: u64,
pub enable_rate_limit_auto_ban: bool,
pub endpoint_rate_limits: HashMap<String, RateLimitEntry>,
}Expand description
The rate-limiting knobs (the reference enable_rate_limiting /
rate_limit / rate_limit_window / enable_rate_limit_auto_ban group).
The defaults are the reference SecurityConfig defaults: rate limiting
on (enable_rate_limiting = true, guard_core/_security_config_fields.py)
with the reference thresholds (10 requests / 60 s window).
Fields§
§enable_rate_limiting: boolenable_rate_limiting. false makes every RateLimiter::check
an unconditional allow that records nothing.
rate_limit: u32rate_limit: maximum requests per client IP inside
rate_limit_window seconds.
rate_limit_window: u64rate_limit_window: the window length in seconds.
enable_rate_limit_auto_ban: boolenable_rate_limit_auto_ban: feed rate-limit crossings into the
auto-ban engine (the rate_limit category of the violation counters)
when the pipeline stage runs with IP banning enabled.
endpoint_rate_limits: HashMap<String, RateLimitEntry>endpoint_rate_limits: the per-endpoint tier map (path -> (requests, window), the reference config field set by dynamic
rules), matched by exact path. Empty by default: the tier is
unconfigured and records nothing.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§impl Debug for RateLimitConfig
impl Debug for RateLimitConfig
Source§impl Default for RateLimitConfig
impl Default for RateLimitConfig
impl Eq for RateLimitConfig
Source§impl PartialEq for RateLimitConfig
impl PartialEq for RateLimitConfig
impl StructuralPartialEq for RateLimitConfig
Auto Trait Implementations§
impl Freeze for RateLimitConfig
impl RefUnwindSafe for RateLimitConfig
impl Send for RateLimitConfig
impl Sync for RateLimitConfig
impl Unpin for RateLimitConfig
impl UnsafeUnpin for RateLimitConfig
impl UnwindSafe for RateLimitConfig
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§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.