rhttp/ratelimit

Provides a per-client token-bucket HTTP middleware, meant for unauthenticated endpoints that trigger outbound requests or other expensive work (e.g.

Package
github.com/cs3org/reva/v3/pkg/rhttp/ratelimit
Source
pkg/rhttp/ratelimit · Go reference
Used by
appprovider, loginflow, ocm, ocdav, sciencemesh, wellknown

Overview

Package ratelimit provides a per-client token-bucket HTTP middleware, meant for unauthenticated endpoints that trigger outbound requests or other expensive work (e.g. OCM provider discovery).

Configuration

KeyTypeDefaultDescription
unauth_rate_limitint-UnauthRateLimit is the sustained number of requests per minute allowed per client on the unauthenticated routes. 0 selects DefaultRequestsPerMinute; a negative value disables limiting. source
unauth_rate_limit_burstint-UnauthRateLimitBurst is how many requests a client may send back-to-back. 0 selects DefaultBurst. source
trusted_proxy_cidrs[]string-TrustedProxyCIDRs lists the reverse proxies whose X-Forwarded-For header is trusted to identify the client. Without it, clients behind a proxy all share the proxy’s address and therefore a single bucket. Any invalid entry aborts service initialization. source