feat: bind the destroy gate to approval_binding_digest and pdp_path
The vocabulary mapping this path was waiting on is not coming: gate-house rejected it in GH-DEC-2026-008, because a translation can be confidently wrong and fails open by accepting a claim approved for a different action. The stronger option arrived instead, and both halves are enforced here. flex-auth published binding.approval_binding_digest (FLEX-DEC-2026-007) to fix the circularity this repo reported: a pdp_digest recorded at issue time can never equal the request_digest of the request that carries the claim in its hashed context, so with GH-DEC-2026-008 requiring that equality, destroy would have failed closed forever on a check no correct record could pass. - authorization.approval_binding_digest implements the published exclusion rule, including Go's context,omitempty behaviour when stripping empties the context; digest_material drops an empty context for the same reason. - validate_decision_envelope recomputes the field rather than trusting it, refuses a claim-bearing request whose decision records none, and compares the claim's digest from step 1 against it -- never against request_digest, which still covers the claim so it stays a sound replay identity. - validate_approval_claim requires binding.pdp_path true before using pdp_digest at all. Path intent is never inferred from a digest that happens to be present; pre-schema-v3 approvals carry pdp_path false regardless of any digest they hold. Replay fixtures re-vendored from dd3ce4c. The destroy pins moved a second and final time; approval_binding_digest did not, which is the point. The fixture now demonstrates the property instead of asserting it: we rederive fa07becf... from its own request through our canonical implementation, proving we hash the same material flex-auth does rather than pinning a constant we cannot reproduce. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E4tNMAYcSQmZWUE4wqP4ij Assistant: claude-code Assistant-Model: opus Assistant-Process: 715726@bnt-lap001 Assistant-Session: 80a42b32-cba6-4b23-8be0-68819b1a6092
This commit is contained in:
parent
67b28f48a8
commit
c44306b1b2
11 changed files with 411 additions and 40 deletions
|
|
@ -150,11 +150,25 @@ def validate_approval_claim(
|
|||
# supplies a binding built in that vocabulary (see the note in
|
||||
# resolve_consume_binding about the missing mapping).
|
||||
if expected_pdp_digest:
|
||||
# GH-DEC-2026-008 / approval-engine schema v3: pdp_path is the issuer's
|
||||
# DECLARATION that this approval was requested against a bound
|
||||
# CheckRequest, and it guarantees pdp_digest is non-null. Path intent is
|
||||
# never inferred from a pdp_digest that merely happens to be present --
|
||||
# a digest recorded for some other reason is not a declaration anybody
|
||||
# made, and approvals issued before schema v3 carry pdp_path false
|
||||
# regardless of any digest they hold.
|
||||
if binding.get("pdp_path") is not True:
|
||||
raise DecisionError(
|
||||
"approval claim does not declare binding.pdp_path; it was not "
|
||||
"issued against a bound CheckRequest and cannot authorize this "
|
||||
"action (GH-DEC-2026-008). Request an approval bound at issue."
|
||||
)
|
||||
if not pdp:
|
||||
raise DecisionError(
|
||||
"approval claim records no pdp_digest, and no published mapping "
|
||||
"exists between approval-engine and secrets-engine action/target "
|
||||
"vocabularies; the claim cannot be tied to this exact action"
|
||||
"approval claim declares pdp_path but records no pdp_digest, and "
|
||||
"no published mapping exists between approval-engine and "
|
||||
"secrets-engine action/target vocabularies; the claim cannot be "
|
||||
"tied to this exact action"
|
||||
)
|
||||
if pdp != expected_pdp_digest:
|
||||
raise DecisionError("approval claim pdp digest does not match the request")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue