feat(BA-7365): key the rate limit counter by user id - #13778
Draft
jopemachine wants to merge 2 commits into
Draft
Conversation
jopemachine
added a commit
that referenced
this pull request
Aug 14, 2026
jopemachine
force-pushed
the
feature/BA-7365-user-keyed-rate-limit-counter
branch
from
August 14, 2026 05:58
3f23516 to
ef4b9b6
Compare
jopemachine
marked this pull request as draft
August 14, 2026 09:12
jopemachine
added a commit
that referenced
this pull request
Aug 14, 2026
jopemachine
force-pushed
the
feature/BA-7365-user-keyed-rate-limit-counter
branch
from
August 14, 2026 09:25
ef4b9b6 to
0881fa0
Compare
jopemachine
added a commit
that referenced
this pull request
Aug 14, 2026
jopemachine
force-pushed
the
feature/BA-7365-user-keyed-rate-limit-counter
branch
from
August 14, 2026 09:34
0881fa0 to
1b8bfd3
Compare
jopemachine
force-pushed
the
feature/BA-7364-auth-response-user-identity
branch
from
August 14, 2026 09:37
1c8bb74 to
b581df7
Compare
`execute_rate_limit_logic()` and `get_rolling_count()` take a `UserID` and build the counter key themselves, and the manager's rate limit middleware counts against the authenticated user instead of the access key, so holding multiple keypairs no longer multiplies a user's allowance. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feature/BA-7365-user-keyed-rate-limit-counter
branch
from
August 14, 2026 14:08
1b8bfd3 to
ecf3a77
Compare
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
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.
📚 Stacked PRs
This PR is part of a 5-PR stack. Merge in order:
feat(BA-7364): deliver the login user id in the auth responsefeat(BA-7365): key the rate limit counter by user id← you are herefeat(BA-7362): move the per-user API rate limit to the user resource policyfeat(BA-7363): publish the per-user rate limit to the shared Redis DBfeat(BA-7365): add a per-user rate limit middleware to the web serverOnly the final tip (#13771) is guaranteed to build / pass CI; intermediate PRs are logical slices for reviewability.
Summary
ValkeyRateLimitClient.execute_rate_limit_logic()andget_rolling_count()take aUserIDand build the counter key (user.<user_id>) themselves, so callers no longer decide the key format.KeyPair.rolling_countin the legacy GraphQL schema resolves against the same per-user counter.Relates to BA-7365.