Skip to content

Spec RFC: document enforcement_mode and gateway_build receipt members #239

Open

Description

@PetrefiedThunder

Problem statement

Schema migration 052, in #236, added two optional signed receipt members: enforcement_mode and gateway_build. #236's CHANGELOG entry and gateway/docs/openapi.json already describe them, but spec/receipt-v0.1.md did not name them. A verifier written from the spec alone would treat a valid receipt carrying either member as using undocumented fields.

Goals

  • Document enforcement_mode and gateway_build in spec/receipt-v0.1.md as additive receipt members.
  • Keep the spec in line with what the gateway already signs.

Non-goals

  • Any receipt member other than these two.
  • Any change to signing, canonicalization, or verification rules.

Proposed design

Both members are optional and are omitted from the signed payload when unset, like the other additive members.

  • enforcement_mode: "enforce" or "permissive", the trust posture the issuing gateway enforced.
  • gateway_build: the commit SHA of the issuing gateway build.

The spec edit in #236 (commit bf5c634) documents this existing behavior: spec/receipt-v0.1.md.

Compatibility and migration

This is additive. Receipts without either member keep identical signed bytes and still verify. Receipts with them verify under the existing rules, because each member is part of the signed payload only when set.

New test vectors (commit 63be05b):

Fixtures: gateway/tests/fixtures/receipt_signing_golden/. The Python offline verifier passes 96/96 vectors, and the TypeScript SDK suite passes all new cases.

Security considerations

Both members are covered by the receipt signature when present, so they can't be added, removed, or changed without breaking it. They are informational: verifiers must not treat them as authorization. A receipt without them still means what it did before.

Alternatives considered

Leave the members undocumented and accept them only in the tests. That leaves the spec out of step with what the gateway signs.

Open questions

None.

Implementation plan

Already in #236: the spec paragraph, the conformance allow-list, the vectors, and the fixtures. Approving this RFC covers the spec edit in that PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions