Repository navigation
Budgets: one consumption record, the AS as usage caller, settlement (#120) - #138
Merged
Merged
Conversation
- budget_consumed is one record, the presented token's, with jti kept so concurrent allocations settle exactly. A record is as of its resource token's iat and final only when that is at or after the auth token's exp. Rationale in Why One Record. Addresses #120. - The usage endpoint admits an access server as caller; the response aud names whichever issuer asked. A general-purpose AS sizes allocations against a ceiling of its own and is not in the resource's trust domain. - Settlement under Unreported Allocations: a final record settles one token early; a usage reading settles every allocation expired by its as_of in aggregate; a calendar ceiling settles itself when allocations are clipped to the period boundary. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KQ7zzXWHFJ4pEjbmF5DnkW
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KQ7zzXWHFJ4pEjbmF5DnkW
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.
Replaces #133, which GitHub closed when its base branch was deleted after #128 merged; content unchanged, rebased onto main.
Stacked on #128 (branch
consent-presentation), which carries the Unreported Allocations section and the comma fix this builds on. Retarget tomainonce #128 merges.Three changes to
draft-hardt-aauth-budgets.md:One consumption record (#120).
budget_consumedbecomes a single{jti, consumed}object for the auth token presented on the request the resource token answers. Every other record duplicated a figure the issuer already had or would settle from a usage reading; the list cost about a kilobyte in the401header and told an agent what was spent under tokens it never held. Thejtistays: an issuer holding several live allocations for one agent cannot attribute an amount alone, and attributing by agent key would make the conservative fallback the normal case for concurrent agents. New: a record is as of its resource token'siat, and is the token's final figure only when that is at or after the auth token'sexp. A record stated while the token was live is a snapshot and releases nothing, which is also why a record on aninsufficient-budgetchallenge cannot free the old token's remainder (the token stays spendable). Rationale section Why One Record.The AS as a usage endpoint caller. The endpoint was PS-only on the assumption that an AS sits in the resource's trust domain. A general-purpose AS (access.aauth.dev fronting resources it does not operate) does not, and it sizes allocations against a ceiling of its own, so it needs the same channel. The existing authorization rule generalizes: the resource answers for values seen in auth tokens whose
issorpsnames the caller. Responseaudnames whichever issuer asked.Settlement. New subsection under Unreported Allocations: how an issuer gets out from under the conservative rule. A final record settles one token early. A usage reading settles every allocation expired by its
as_ofin aggregate,free = ceiling − metered − Σ unsettled allocations, without naming any of them; the only over-count is spend under still-live tokens, which vanishes as they expire. An issuer with a calendar-period ceiling SHOULD clip allocations to the period boundary, after which the period settles itself with no query.The model is implemented and tested in the access module (allocation ledger DO, settlement by record and by reading on an alarm, randomized many-token simulation asserting the issuer never over-authorizes). The simulation is what surfaced the record-finality rule.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KQ7zzXWHFJ4pEjbmF5DnkW