You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: bearer quota follow-ups: per-key budget override and RateLimit fields on allowed responses #703
#572 added a per-credential quota to auth bearer routes: auth: {bearer: {scopes, quota: {requests, window}}}. Two gaps remain:
Budgets are per route, not per key. Hosted-API evidence in [Request]: throttle partition keyed by credential, with a shared or durable counter store #572 described per-token quotas, where different tokens get different plans. Today every key on a route gets the same budget. The workaround is to issue keys against separate routes with different budgets, which does not fit plan tiers well.
Allowed responses carry no credential RateLimit fields. An extension authorize() hook can only refuse, so a client learns its remaining credential budget only when it gets the 429. Core throttle adds RateLimit to every response.
Proposed behavior and alternatives
An optional quota on the issued key record (issueApiKey({name, scopes, quota}), CLI JSON on stdin), stored in auth_api_keys. The route budget and the key budget would apply independently (both counted, either can refuse), or the key budget would replace the route's. This needs a decision.
Per-key budget replaces the route budget. When an issued key carries its own quota, that key is counted against its own budget only, and the route's auth.bearer.quota applies to keys without one. A server-wide ceiling remains available through core policies.throttle, which is independent of the auth quota and still applies to every request.
Activity
feat(auth): per-credential quota on bearer routes (#572) (#704)
jimhoyd commentedon Sep 25, 2026
Decision (owner, 2026-09-25):
quota, that key is counted against its own budget only, and the route'sauth.bearer.quotaapplies to keys without one. A server-wide ceiling remains available through corepolicies.throttle, which is independent of the auth quota and still applies to every request.middleware()hook on bearer routes so allowed responses getRateLimit: "credential";r=..;t=..(andRateLimit-Policy). These values are per credential, so they must never be stored in or served from a shared cache. [Bug]: core throttle's response phase overwrites RateLimit fields on an extension's 429 #701 is fixed in fix(core): name the failing field in validation errors and keep extension RateLimit policies (#702, #696, #701) #720, so throttle's"default"member now sits alongside the credential one.Ready to implement. Removing
needs-decision.Generated by Claude Code
feat: per-key quota, relative form date bounds, store-owned CRUD scre…