Expand description
Shared Actix rate-limit building blocks.
This module keeps product-neutral rate-limit mechanics in Forge while leaving product response envelopes and protocol-specific error bodies in application crates. It provides:
- a trusted-proxy-aware IP key extractor for
actix-governor; - small quota helpers for building Actix governor configs from non-zero
(seconds_per_request, burst_size)pairs; - a keyed string limiter for protocol endpoints that rate-limit by usernames, emails, or other normalized business keys.
Structs§
- Normalized
String Rate Limiter - A keyed string rate limiter with product-neutral key normalization.
- Rate
Limit Rejection - Product-neutral rate-limit rejection metadata.
- Trusted
Proxy IpKey Extractor
Functions§
- build_
ip_ governor_ config - Builds an Actix governor config using the trusted-proxy-aware IP extractor.
- build_
ip_ governor_ config_ with_ rejection_ response - Builds an Actix governor config with a product-provided rejection response.
- retry_
after_ seconds - Returns the retry delay in whole seconds for a governor rejection.