Publish approval_binding_digest: a claim cannot name the request carrying it
secrets-engine confirmed T03, and re-verifying against the regenerated destroy fixture found something neither repository can fix alone: a pdp_digest recorded at issue time can never equal the request_digest of a request that carries the claim in its context, because the claim is part of the context that is hashed. Embedding the claim changes the very digest the claim would need to name. Not fixture staleness. It holds for every dual-control request whose claim travels in context -- the shape GH-DEC-2026-008 had just ruled mandatory. Left unresolved that ruling was unimplementable for exactly the case it was written for, and destroy would have been permanently un-allowable in production, failing closed forever on a check that could never pass. flex-auth owns the canonical request digest, so the fix is ours. binding.approval_binding_digest is the same material with context.approval removed, emitted only when a claim was carried. An approval issued against a claim-free Check records that Check's request_digest; the claim-bearing request reproduces it here. DELIBERATELY ADDITIVE, and the reason matters. The tempting fix is to drop context.approval from request_digest entirely. That is wrong: request_digest is the replay identity, and two requests differing only in which approval was presented must not share one, because their decisions differ -- one allows, the other denies dual_control_required. Collapsing them would let an allow obtained with a valid claim be replayed against a request carrying none. So request_digest still covers the claim and still moves; approval_binding_digest deliberately does not, and is documented as not a replay identity. The tests assert the two functions DISAGREE on a claim-bearing request, which is approval-engine's formulation of how to defend a distinction that looks like duplication. The fixture now demonstrates the property rather than asserting it: its claim's pdp_digest equals the envelope's approval_binding_digest with pdp_path true, and changing the claim's contents moved request_digest while leaving approval_binding_digest untouched. Two files a consumer can diff. Also picked up approval-engine's new required binding.pdp_path via the cross-repo schema test added yesterday -- which is the test doing exactly what it was built for, one day later. T03 is done. secrets-engine's own digest-material defect, which our two real envelopes caught, is recorded in the workplan. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JTbVXpEiXA7mNJVpDnEPcB Assistant: claude-code Assistant-Model: opus Assistant-Process: 412054@bnt-lap001 Assistant-Session: 3968fae1-8d59-4209-9bd6-c22594b8ab19
This commit is contained in:
parent
9f3e7e363a
commit
dd3ce4c109
13 changed files with 631 additions and 85 deletions
|
|
@ -96,3 +96,49 @@ Any of the following refuses replay:
|
|||
|
||||
Local fixtures, State Hub `/decisions/{uuid}` records, and free-form
|
||||
`decided_by` values are not this test.
|
||||
|
||||
## The approval-binding digest
|
||||
|
||||
`binding.approval_binding_digest` is this same digest computed with an approval
|
||||
claim removed from `context`. It appears only when the request carried one on
|
||||
`context.approval`.
|
||||
|
||||
### Why a second digest exists
|
||||
|
||||
An approval's `pdp_digest` is recorded **at issue time**. The request that later
|
||||
carries that claim inside its hashed context has a different `request_digest` by
|
||||
construction, because the claim is part of the context that is hashed. So:
|
||||
|
||||
> A `pdp_digest` recorded at issue time can never equal the `request_digest` of
|
||||
> the request that carries the claim.
|
||||
|
||||
`secrets-engine` found this while verifying a replay fixture, and it is not a
|
||||
fixture defect — it is circular by construction. Left unresolved it would make
|
||||
`GH-DEC-2026-008` unimplementable for exactly the case it was written for: a
|
||||
dual-control action whose claim travels in context.
|
||||
|
||||
`approval_binding_digest` is stable across attaching the claim. An approval
|
||||
issued against a claim-free Check records that Check's `request_digest`, and the
|
||||
later claim-bearing request reproduces the same value here.
|
||||
|
||||
### The comparison
|
||||
|
||||
```text
|
||||
claim.binding.pdp_digest == decision.binding.approval_binding_digest
|
||||
```
|
||||
|
||||
Never against `request_digest`. Comparing to `request_digest` cannot succeed on a
|
||||
claim-bearing request.
|
||||
|
||||
### It is not a replay identity
|
||||
|
||||
`request_digest` remains the §6.4.2 replay test and still covers the approval
|
||||
claim. `approval_binding_digest` deliberately does not: two requests differing
|
||||
only in which approval was presented share it, **and their decisions do not** —
|
||||
one allows, the other denies `dual_control_required`.
|
||||
|
||||
Collapsing the two would let an allow obtained with a valid claim be replayed
|
||||
against a request carrying none. That is why this is an additional field rather
|
||||
than a redefinition of the existing one, and why `pkg/api/approval_binding_test.go`
|
||||
asserts the two functions **disagree** on a claim-bearing request. A test that a
|
||||
distinction is real is how a distinction that looks like duplication is defended.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue