Expand description
The attestation format: the payload’s fields, the note’s blocks, and the names every producer and verifier shares (SPEC.md, “The note”).
Structs§
- Block
- One signed statement out of a note: the exact bytes that were signed (trailing newline included) and the armored signature over them.
Constants§
- FORMAT
- First token of every payload. A verifier that does not recognise this string must treat the note as absent: an unknown version may mean anything, and “run the tests” is the only safe reading of anything.
- INPUTS_
REF - The second notes ref, keyed by input fingerprint rather than by object.
Every key there is a synthetic oid that is not an object, which is why it
is a separate ref:
git notes pruneon it would drop everything, and the main ref keeps its 1.x invariant that every key is real. - LOCAL_
PREFIX - Where
sign.sh --no-pushkeeps blocks that never reached origin, underrefs/notes/, prefixed to either ref name above. Origin cannot revoke them, so a verifier reads them only when asked (--include-local). - MAX_
BLOCKS - How many blocks of one note are read. Every block costs two
ssh-keygenruns, and the notes ref is writable by anyone with push access. - NAMESPACE
- The
ssh-keygen -Ynamespace. Namespaces exist so a signature minted for one purpose cannot be replayed for another; anallowed_signersentry pinned to this namespace accepts nothing else. - NOTES_
REF - The notes ref, as
git notes --refwants it.
Functions§
- block
- A signed block as a note holds it: the payload without its trailing newline, a blank line, the armored signature without its own.
- canon_
claim - The canonical fingerprint a block claims: a
canon <oid>line of exactly two blank-separated fields, first occurrence wins. A malformed oid is not a claim. - field
- Read a payload field BY PREFIX, never by line position: the payload has
grown a line once already (v1 -> v2 added
platform), and a positional reader silently mis-assigns every field after an insertion rather than failing. First match wins, so a secondgatesline cannot smuggle a value past the caller. - input_
fp - The fingerprint a block claims for
gate: aninput <gate> <fp>line of exactly three blank-separated fields, first occurrence wins. Byte-strict likefield; a fourth field or a malformed oid is not a claim. - is_oid
- A 40- or 64-hex object id, as
hash-objectprints one. - payload
- The payload of an attestation, in the exact shape SPEC.md gives:
tree,gates,platform, theinputlines in spec order,canon, then the producer line, each followed by LF. The same inputs give the same bytes, so a re-run recognises its own block. - platform
- Where a suite ran, as
<arch>-<os>. Coarser than a target triple on purpose: the libc flavour is not somethingstdcan answer, and the question a CI matrix actually asks is “did this run on MY leg”. - platform_
matches - Does an attestation minted on
ran_onsatisfy what the caller asked for? - split_
blocks - A note into its blocks. Since 1.2.0 a note may hold several — a laptop’s
and a CI job’s, each on its own platform — separated by blank lines, which
is exactly what
git notes appendproduces. - split_
note - The first block of a note, as payload and signature.