ratelimit

package
v1.1.66 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ratelimit provides helpers for applying distributed request throttling.

Index

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 plus a client-ID keyed limiter for automated client_credentials traffic.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL