feat(BA-7362): move the per-user API rate limit to the user resource policy - #13779
Draft
jopemachine wants to merge 5 commits into
Draft
Conversation
jopemachine
added a commit
that referenced
this pull request
Aug 14, 2026
This was referenced Aug 14, 2026
jopemachine
marked this pull request as draft
August 14, 2026 08:56
…policy The rate limiter now reads `user_resource_policies.max_api_requests_per_window` instead of `keypairs.rate_limit`, so the allowance belongs to the user rather than to whichever keypair signed the request. NULL keeps meaning unlimited. The keypair column and its API fields are kept and marked deprecated: they are still stored and returned, but no longer enforced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GraphQL Inspector treats a new input field without an `Added in X.Y.Z` description as a breaking change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feature/BA-7362-user-policy-api-request-limit
branch
from
August 14, 2026 14:11
457903a to
60d2e75
Compare
jopemachine
changed the base branch from
feature/BA-7365-webserver-user-rate-limit-middleware
to
feature/BA-7365-user-keyed-rate-limit-counter
August 14, 2026 14:11
Co-authored-by: octodog <mu001@lablup.com>
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 idfeat(BA-7362): move the per-user API rate limit to the user resource policy← you are herefeat(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
max_api_requests_per_windowcolumn touser_resource_policies(NULL means unlimited) and plumb it through the v2 stack: row, data type, creator/updater specs, filters and orders, v2 DTOs, GQL v2 node/mutation/filter types, the adapter, and the admin CLI.keypairs.rate_limit— the manager middleware fromrequest["user"]["resource_policy"], and the auth response (which the web server stores in its session) from the policy resolved at login. The allowance now belongs to the user rather than to whichever keypair signed the request.keypairs.rate_limitis deprecated, not removed: the column and its API fields are still written and returned, but nothing enforces them. The legacy GQL field carries adeprecation_reasonand the v2 keypair DTO fields are markeddeprecated=True.AuthenticatedKeypair.rate_limitis dropped since the rate limiter was its only reader.Existing deployments start with the new column NULL, which means unlimited — an operator must set the policy value to restore a limit.
Resolves BA-7362.
📚 Documentation preview 📚: https://sorna--13779.org.readthedocs.build/en/13779/
📚 Documentation preview 📚: https://sorna-ko--13779.org.readthedocs.build/ko/13779/