feat(schemas): ProvenanceLabelAllowlist caveat + narrowing helper (#226) - #246
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 42 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mirror the AD-060 typed egress-class caveat discipline for provenance origins (D-174, spec #220). Add Caveat::ProvenanceLabelAllowlist, its MAC-covered caveat_bytes arm, SupportedCaveatKind + fail-closed arm, and effectively_allows_provenance_label (chain-only intersection, empty-list narrows, no root field so the MAC stays consistent per AD-148). Worker sub-grants adopt an empty caveat (provably closed); the v1 single-owner owner grant is minted without it (dormant). Gate declares the caveat supported so worker grants still validate; no gate-time origin enforcement (request-side input out of scope, owned in parallel by dev-224). Closes #226
36e5751 to
2b96fac
Compare
What
Adds the
ProvenanceLabelAllowlistgrant caveat and its narrowing helpereffectively_allows_provenance_label, an exact mirror of the AD-060 typed egress-class caveat discipline (D-174, spec #220). Builds on #222 (ProvenanceOrigin/IdentityRef, merged).crates/openspine-schemas/src/grant_chain.rs:Caveat::ProvenanceLabelAllowlist { origins: Vec<ProvenanceOrigin> }, its MAC-coveredcaveat_bytesarm,SupportedCaveatKind::ProvenanceLabelAllowlist+ exhaustive fail-closed arm inhas_unsupported_caveats_except, andeffectively_allows_provenance_label.crates/openspine-authority/src/worker_grant.rs:mint_worker_grantappends an emptyProvenanceLabelAllowlistunconditionally (mirrors the emptyEgressClassAllowlist).crates/openspine-gate/src/gate.rs:chain_valid()declares the caveat supported.Why
The Immune-system egress gate must be able to narrow which typed-identity origin's data a sub-grant may disclose. Per spec #220 / D-174, authority to widen that closure travels the grant chain as a caveat that can only narrow — chain-appended, empty-list-narrows, fail-closed on unknown, never a root-field mutation (there is no provenance root field; adding one would desync
seal_child_from_parent_tipfromverify_mac, AD-148).v1 posture / scope
Tests
Mirror the egress-class suite: intersection/empty-list narrowing, named-origin narrowing, MAC tamper detection (caveat is MAC-covered), fail-closed-unless-supported, and worker sub-grant narrowing (MAC stays valid per AD-148).
./scripts/check.shpasses green.Implementation-notes summary
Caveat::ProvenanceLabelAllowlist { origins: Vec<ProvenanceOrigin> }, its MAC-coveredcaveat_bytesarm,SupportedCaveatKind::ProvenanceLabelAllowlist+ fail-closed arm, andeffectively_allows_provenance_label— an exact mirror of the egress-class caveat (AD-060).seal_child_from_parent_tipandverify_mac(AD-148); empty list narrows to "no origin allowed", unknown caveat fails closed.mint_worker_grantappends an emptyProvenanceLabelAllowlistso worker sub-grants are provably closed; the owner grant is minted without it (dormant on the v1 single-owner grant).gate.rs::chain_valid()declares the new kind supported so worker grants still validate; no gate-time origin enforcement (request-side input out of scope, owned by dev-224's label binding)../scripts/check.shpasses green.Closes #226
Summary by cubic
Adds a provenance-origin allowlist caveat and a narrowing helper so sub-grants can only disclose data from permitted origins. Previously origins were not narrowable; now origin membership intersects across chain caveats, empty lists narrow to none, and the caveat is MAC-covered and fails closed unless the verifier declares support.
openspine-schemas: addsCaveat::ProvenanceLabelAllowlist { origins: Vec<ProvenanceOrigin> }, canonicalizescaveat_bytes, declaresSupportedCaveatKind::ProvenanceLabelAllowlist, fail-closed validation, andeffectively_allows_provenance_label(...)(chain-only intersection; no root field).openspine-authority:mint_worker_grantappends an empty ProvenanceLabelAllowlist to worker sub-grants (provably closed). Owner grants are unchanged. Test fixture retypedTaskGrant.usertoPrincipalId.openspine-gate: declares the new caveat supported in chain validation; no gate-time origin enforcement yet.openspine-gate) to this version before minting or relying on worker grants with this caveat. No data migrations.Written for commit 2b96fac. Summary will update on new commits.