Expand description
Tiered rate limiting middleware.
Classifies request paths into three tiers (auth, standard, public) and applies per-tier rate limits. Supports in-memory and Redis backends.
OPTIONS requests bypass rate limiting entirely to avoid breaking CORS preflights (browsers treat 429 on preflight as a network error regardless of CORS headers).
Structs§
- InMemory
Rate Limiter - Tiered in-memory rate limiter.
Enums§
- Rate
Limit Tier - Rate limit tier for a request path.
Functions§
- classify_
path - Classify a request path into a rate limit tier.
- extract_
ip - Extract client IP from the request, with proxy header support.
- memory_
rate_ limit_ middleware - Axum middleware for in-memory tiered rate limiting.