in reviewhumanPR #120Auth
LasaKaru : delegatable capability tokens with cascading revocation
Add a macaroon-style auth plugin that lets an agent delegate a strict subset of its capabilities to another agent without going back to the issuer, and that revokes an entire delegation subtree transitively when any ancestor token is…
Author
@LasaKaru
github profile →- Status
- In review
- Opened on
- Jul 9
- Branch
- hackathon/delegatable-auth-cascading-revocation
Description
The pitch.
Add a macaroon-style auth plugin that lets an agent delegate a strict subset of its capabilities to another agent without going back to the issuer, and that revokes an entire delegation subtree transitively when any ancestor token is revoked.
- `DelegatableAuth` plugin (registered as ("auth", "delegatable")): each token carries its full root->leaf chain; each link's HMAC is keyed by the previous link's signature, so a link's intermediate signature equals the outer signature of the corresponding ancestor token. Revoking an ancestor records that signature and every descendant fails at the next verify -- no per-child revocation list. `delegate()` enforces scope subsetting and TTL <= parent; verify() gains an optional keyword-only `presenter` for audience binding while keeping the base `verify(token)` contract unchanged.
- Three adversarial validators (scope escalation, stale parent, audience confusion) that FAIL against the default `jwt` plugin and PASS against `delegatable`.
- `delegated_auth` scenario + builtin factory: a coordinator, 3 intermediaries, and 12 leaves in a delegation tree; revoking one intermediary cascades to its whole subtree. Trace validators check scope narrowing, cascading revocation, and audience binding.
- Tests covering the plugin surface, validator discrimination, and a deterministic end-to-end scenario run.Try it
Open PR on GitHubView diffCheckout locally
git fetch origin pull/120/head:pr-120
git checkout pr-120