Documentation
¶
Overview ¶
Package ratelimit provides helpers for applying distributed request throttling.
Index ¶
- func ApplyOAuthRegistrationRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
- func ApplyOAuthTokenRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
- func ApplyRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOAuthRegistrationRateLimit ¶ added in v1.1.53
func ApplyOAuthRegistrationRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
ApplyOAuthRegistrationRateLimit wraps /oauth/register with a tighter unauthenticated limit and an OAuth-friendly 429 payload for discovery clients.
func ApplyOAuthTokenRateLimit ¶ added in v1.1.53
func ApplyOAuthTokenRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
ApplyOAuthTokenRateLimit wraps /oauth/token with the standard path/IP limiter.
func ApplyRateLimit ¶
func ApplyRateLimit(handler apptheory.Handler, limit int, window time.Duration, logger *zap.Logger) apptheory.Handler
ApplyRateLimit wraps a handler with a DynamoDB-backed rate limiter.
This is a hard cutover: no Lift runtime types or middleware are used.
Fail-open: if limiter creation/check fails, the request proceeds.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.