| 1 | # The attestation helper: the written form as a fixed contract, and the |
| 2 | # helper driven end to end over scratch repositories. |
| 3 | { pkgs, packages, ... }: |
| 4 | { |
| 5 | # The written form and the note envelope, held to fixed vectors. |
| 6 | # These bytes are an interop contract rather than an |
| 7 | # implementation detail: a regenerated or independently written |
| 8 | # attest must produce them identically or every signature already |
| 9 | # made stops verifying. So the vectors are checked-in files with a |
| 10 | # README saying they are the contract (attest/conformance/), and |
| 11 | # this check is what holds a second implementation to them. |
| 12 | attest-conformance = pkgs.runCommand "valley-attest-conformance" { |
| 13 | nativeBuildInputs = [ |
| 14 | pkgs.cue |
| 15 | packages.attest |
| 16 | ]; |
| 17 | vectorDir = ../../attest/conformance; |
| 18 | schema = ../../schema/attestation.cue; |
| 19 | } (builtins.readFile ./attest-conformance.sh); |
| 20 | |
| 21 | # The helper itself, driven end to end over scratch repositories |
| 22 | # and a throwaway key: what it publishes, what it refuses to |
| 23 | # publish, and what a verifier makes of both. |
| 24 | # |
| 25 | # Every check there uses the command runner. The nix runner cannot |
| 26 | # be exercised from inside a nix build — there is no daemon in the |
| 27 | # sandbox — so what a pure statement looks like is pinned by |
| 28 | # attest-schema and by the unit tests over the digest scheme, and |
| 29 | # the runner itself is exercised by running the helper outside the |
| 30 | # sandbox. |
| 31 | attest-e2e = pkgs.runCommand "valley-attest-e2e" { |
| 32 | nativeBuildInputs = [ |
| 33 | pkgs.git |
| 34 | pkgs.openssh |
| 35 | packages.attest |
| 36 | ]; |
| 37 | } (builtins.readFile ./attest-e2e.sh); |
| 38 | } |