-
Notifications
You must be signed in to change notification settings - Fork 39
Add rate limiter and example #1255
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
9fcb7d7 to
e17ada8
Compare
e17ada8 to
a058ae5
Compare
a058ae5 to
66c3391
Compare
3b8ab1d to
64201e5
Compare
53fa0e6 to
472968e
Compare
472968e to
36bd494
Compare
36bd494 to
aeabe07
Compare
mkysel
approved these changes
Oct 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Add a Redis-backed publish rate limiter and surface
Retry-AfterwithResourceExhaustedin gRPC responses while configuring a 10s Redis connect timeout acrossgatewaysetupIntroduce a concrete Redis-backed rate limit authorizer via
authorizers.NewRateLimitAuthorizer, integrateGatewayServiceErrorwithRetryAfterandResourceExhaustedhandling in the gRPC interceptor, and update thegatewaybuilder to create or reuse a Redis client with a configurableconfig.RedisOptions.ConnectTimeoutset to10s. Add a builder for rate limit authorizers, refactor nonce manager setup to accept a shared Redis client, and include a runnable example wiring the limiter into the gateway.📍Where to Start
Start with the
authorizers.NewRateLimitAuthorizerimplementation and its usage in the interceptor path in pkg/gateway/authorizers/ratelimit.go and then review the gRPC error mapping in pkg/gateway/interceptor.go.📊 Macroscope summarized aeabe07. 11 files reviewed, 2 issues evaluated, 1 issue filtered, 0 comments posted
🗂️ Filtered Issues
pkg/gateway/builder.go — 0 comments posted, 1 evaluated, 1 filtered
SetupRedisClientcallsctx.Err()(line 316) without guarding against a nilctx. If any caller passes a nil context (which is possible because there is no visible guard or constructor guarantee preventing it), the method call panics withinvalid memory address or nil pointer dereference, crashing the process before the Redis client is set up. Add an explicit nil check (e.g., return an error or substitutecontext.Background()) before dereferencingctx. [ Out of scope ]