Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve rate limiting with better customization #1476

Merged
merged 10 commits into from
Jan 7, 2025

Conversation

jensneuse
Copy link
Member

This PR adds the following 2 features:

  1. Being able to add a suffix to the rate liming key from a client request header or claim: This allows to rate limit different users. Currently, there's only a global rate limit
  2. Being able to return a custom status code when we reject a request, e.g. 429 (can be a company security policy)

Copy link

github-actions bot commented Dec 23, 2024

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-f85b4a00e4fe5204e80bb45baf5e2f88ade621b4

router/core/ratelimiter.go Outdated Show resolved Hide resolved
router/core/ratelimiter.go Outdated Show resolved Hide resolved
router/pkg/config/config.go Show resolved Hide resolved
Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jensneuse jensneuse requested a review from StarpTech January 7, 2025 10:55
Co-authored-by: Dustin Deus <deusdustin@gmail.com>
Copy link
Contributor

@StarpTech StarpTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM great use of our expr language

@jensneuse jensneuse merged commit ffcb634 into main Jan 7, 2025
13 checks passed
@jensneuse jensneuse deleted the jens/eng-6204-improve-rate-limiting-implementation branch January 7, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants