Expand description
hyperlane-plugin-rate-limit
64-way sharded lock-free atomic GCRA and fixed-window rate limiter plugin
for Hyperlane with extensible KeyExtractor and RateLimitStore traits
and RFC RateLimit-* response headers.
Structs§
- Client
IpKey Extractor - Built-in
KeyExtractorpartitioning traffic by client IP address. - Header
KeyExtractor - Built-in
KeyExtractorpartitioning traffic by a specific request header value (for exampleX-Api-Key). - Path
AndIp KeyExtractor - Built-in
KeyExtractorpartitioning traffic by(request_path, client_ip). - Rate
Limit Decision - Result of evaluating one request against a
RateLimitStore. - Rate
Limit Hook - Opt-in
ServerHookenforcing configured rate limits and attaching RFCRateLimit-*headers. - Rate
Limit Plugin - Process-wide
RateLimitPluginregistry storing policy,RateLimitStore, andKeyExtractor. - Rate
Limit Policy - Configuration policy governing
ShardedRateLimiterandRateLimitPlugin. - Sharded
Rate Limiter - High-concurrency 64-way sharded lock-free in-memory
RateLimitStore.
Enums§
- Rate
Limit Algorithm - Rate-limiting algorithm used by
crate::ShardedRateLimiter.
Constants§
- DEFAULT_
RATE_ LIMIT_ BURST - Default burst capacity when not overridden.
- DEFAULT_
RATE_ LIMIT_ MAX_ KEYS - Default maximum tracked distinct rate-limit keys across all shards.
- DEFAULT_
RATE_ LIMIT_ REQUESTS - Default maximum requests permitted per window.
- DEFAULT_
RATE_ LIMIT_ WINDOW_ MS - Default rate-limit window duration in milliseconds (60 seconds).
- HEADER_
RATE_ LIMIT_ LIMIT - Standard
RateLimit-Limitresponse header name. - HEADER_
RATE_ LIMIT_ REMAINING - Standard
RateLimit-Remainingresponse header name. - HEADER_
RATE_ LIMIT_ RESET - Standard
RateLimit-Resetresponse header name (seconds until window/burst reset).
Traits§
- KeyExtractor
- Extracts the rate-limiting partition key (for example client IP, API key, or user + route).
- Rate
Limit Store - Pluggable rate-limit decision backend (in-memory sharded or external distributed store).