jcp-bridge: an OAuth access token narrows to the grant's caveats or is not minted, and a delegated grant needs its chain #321
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/jcp-oauth-projects-caveats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The defect
grant_to_access_tokenprojects a JCP grant into an RFC 9068 access token, so an MCP or OAuth resource server can enforce it with ordinary JWT tooling. It carried the capability, the expiry and the joule budget, and dropped everything else. The resource server enforced more authority than the grant conveyed:NotAfternarrower than the expiry was ignored, and so was anyNotBefore.ActionIndid not narrowscope.PayloadIs,MaxCostUj,ModelIn, a flow ceiling and a money ceiling.verify_access_tokennever checkednbf.The fix
A projection may narrow, never widen.
NotAfterlowersexp.NotBeforeraisesnbf.ActionInintersectsscope.CallerIsnaming the subject adds nothing, sincesubalready names it.Unprojectablefor a condition no claim a resource server is known to enforce can carry:PayloadIs,MaxCostUj,ModelIn, a flow ceiling, a money ceiling.PermitsNothingfor a grant whose conditions leave nothing to permit: no action, an empty window, or a caller other than the subject.grant_to_access_tokenrefuses them (Delegated).chain_to_access_tokenprojects a chain, verified hop by hop. Every link boundsexp, and every link's caveats apply.verify_access_tokenenforcesnbfas well asexp.The only caller in the repository is the mint example, which still runs.
Checked
On the build host:
NotAfterPayloadIsnbf🤖 Generated with Claude Code