Require a WP-0025 broker receipt at admit-plane

Platform reproduced a recanonicalized projection receipt with a
substituted all-zero broker digest on the operational path. WP-0025
admission now requires --broker-receipt, threads it through
broker_from_receipt, and refuses unless the digest matches exactly.

Assistant: grok
Assistant-Session: 01a02670-3345-76f2-a014-70fde8e2a2bb
This commit is contained in:
tegwick 2026-08-22 22:32:15 +02:00
parent cb6620f33b
commit 0db73f0605
5 changed files with 140 additions and 17 deletions

View file

@ -245,6 +245,16 @@ def test_receipt_without_contract_is_refused(tmp_path):
broker_from_receipt(path)
def test_receipt_without_broker_is_refused(tmp_path):
bound = contract()
receipt = tmp_path / "receipt.json"
contract_path = tmp_path / "contract.json"
receipt.write_text(json.dumps(projection_receipt(bound)), encoding="utf-8")
contract_path.write_text(json.dumps(bound), encoding="utf-8")
with pytest.raises(AuthorizationError, match="requires a bound broker receipt"):
broker_from_receipt(receipt, contract_path=contract_path)
def test_noncanonical_receipt_id_is_refused():
receipt = projection_receipt()
receipt["receipt_id"] = "sha256:" + "e" * 64