Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Axum rate limits with explicit peer/key and rejection-response boundaries.

Re-exports§

pub use crate::shared::rate_limit::NormalizedStringRateLimiter;
pub use crate::shared::rate_limit::RateLimitRejection;

Structs§

IpRateLimitConfig
State for from_fn_with_state(config, ip_rate_limit). Clones share the same quota buckets.
KeyedRateLimitConfig
State for keyed limits. Product code extracts the key; Forge trims and lowercases it.

Functions§

ip_rate_limit
Applies trusted-proxy IP limits. Missing peers/UDS share a localhost bucket and ignore headers. Products should disable IP limits or use keyed limits on UDS deployments.
keyed_rate_limit
Applies a normalized string quota, preserving product key-extraction errors.