diff --git a/.github/actions/verify-seal/README.md b/.github/actions/verify-seal/README.md new file mode 100644 index 0000000000..d4b2844219 --- /dev/null +++ b/.github/actions/verify-seal/README.md @@ -0,0 +1,51 @@ +# Verify OpenAdapt Seal (GitHub Action) + +Offline cryptographic verification for [OpenAdapt](https://github.com/OpenAdaptAI/OpenAdapt) run receipts (`record/run/v1` DSSE envelopes and `openadapt.receipt-card/v1` public cards). + +- **Zero network egress** during verification: checks Ed25519 signatures and receipt invariants strictly against local pinned key material. +- **Fail-closed**: exits with code `1` on any missing receipt, missing/unknown key, malformed JSON, or tampered payload/signature. +- **GitHub Step Summary**: writes a concise verification table to `$GITHUB_STEP_SUMMARY` and exposes `verified`, `receipt-id`, `outcome`, and `reason` step outputs. + +## Usage + +```yaml +- uses: OpenAdaptAI/OpenAdapt/.github/actions/verify-seal@main + with: + receipt: path/to/receipt.json + public-key: path/to/public-key.pem # Ed25519 PEM or openadapt.receipt-keys/v1 JSON +``` + +### Inputs + +| Input | Required | Default | Description | +| --- | --- | --- | --- | +| `receipt` | Yes | — | Path to `receipt.json` (`record/run/v1` DSSE envelope or public card). | +| `public-key` | No* | `""` | Path to an Ed25519 public key `.pem` file or `openadapt.receipt-keys/v1` JSON registry. | +| `keys` | No* | `""` | Path to an `openadapt.receipt-keys/v1` pinned key registry JSON file. | +| `key-role` | No | `this_computer` | Signer role assigned when `public-key` is a raw PEM file (`this_computer`, `customer_key`, `openadapt_cloud`, `public_log`, `demo`). | +| `openings` | No | `""` | Optional path to a `receipt.private.json` openings sidecar. | +| `python-version` | No | `3.12` | Python version used to run verification. | +| `install-mode` | No | `auto` | `auto` (local `packages/types` if present, else PyPI), `pypi`, or `skip`. | + +\* At least one of `public-key` or `keys` must be supplied; verification fails closed if no trusted key is configured. + +### Outputs + +| Output | Description | +| --- | --- | +| `verified` | `'true'` when offline verification passes, `'false'` otherwise. | +| `receipt-id` | Verified run/receipt identifier (empty on failure). | +| `outcome` | Recorded run outcome (`VERIFIED`, `STOPPED`, etc.; empty on failure). | +| `reason` | Empty on success, or the fail-closed refusal reason code on failure. | + +### Example Step Summary + +> ### ✅ Verified by OpenAdapt Seal +> +> | Field | Value | +> | --- | --- | +> | **Status** | Verified offline (Ed25519) | +> | **Receipt ID** | `run_2026_11_22_001` | +> | **Run Outcome** | `VERIFIED` | +> | **Ed25519 Signature** | Signed by customer key | +> | **Offline Verification** | `openadapt verify path/to/receipt.json` | diff --git a/.github/actions/verify-seal/action.yml b/.github/actions/verify-seal/action.yml new file mode 100644 index 0000000000..1c4452dfaf --- /dev/null +++ b/.github/actions/verify-seal/action.yml @@ -0,0 +1,109 @@ +name: "Verify OpenAdapt Seal" +description: "Offline cryptographic verification of OpenAdapt run receipts (record/run/v1) with GitHub Step Summary." +author: "OpenAdaptAI" + +branding: + icon: "shield" + color: "green" + +inputs: + receipt: + description: "Path to an OpenAdapt receipt JSON file (DSSE record/run/v1 envelope or openadapt.receipt-card/v1)." + required: true + public-key: + description: "Optional path to an Ed25519 public key PEM file or an openadapt.receipt-keys/v1 JSON registry." + required: false + default: "" + keys: + description: "Optional path to an openadapt.receipt-keys/v1 JSON pinned key registry." + required: false + default: "" + key-role: + description: "Trusted signer role assigned when public-key is a raw Ed25519 PEM file (this_computer, customer_key, openadapt_cloud, public_log, or demo)." + required: false + default: "this_computer" + openings: + description: "Optional path to a receipt.private.json openings sidecar." + required: false + default: "" + accepted-outcomes: + description: "Comma-separated list of receipt outcomes that pass the gate (default: VERIFIED)." + required: false + default: "VERIFIED" + allow-demo: + description: "Set to 'true' to accept receipts signed only by a demo-role key (default: 'false')." + required: false + default: "false" + python-version: + description: "Python version used to run offline verification." + required: false + default: "3.12" + install-mode: + description: "Dependency install mode: auto (local packages/types if present, else PyPI), pypi, or skip." + required: false + default: "auto" + +outputs: + verified: + description: "'true' if the receipt passed offline cryptographic verification, otherwise 'false'." + value: ${{ steps.verify.outputs.verified }} + receipt-id: + description: "The verified run or receipt identifier, or empty on failure." + value: ${{ steps.verify.outputs.receipt-id }} + outcome: + description: "The recorded run outcome from the verified receipt (e.g. VERIFIED, STOPPED), or empty on failure." + value: ${{ steps.verify.outputs.outcome }} + reason: + description: "Empty on success, or the fail-closed refusal reason code on failure." + value: ${{ steps.verify.outputs.reason }} + +runs: + using: "composite" + steps: + - name: Set up Python + if: inputs.install-mode != 'skip' + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 + with: + python-version: ${{ inputs.python-version }} + + - name: Install offline verifier dependencies + if: inputs.install-mode != 'skip' + shell: bash + env: + ACTION_PATH: ${{ github.action_path }} + INSTALL_MODE: ${{ inputs.install-mode }} + run: | + set -euo pipefail + python -m pip install --quiet --disable-pip-version-check --require-hashes -r "${ACTION_PATH}/requirements.txt" + + - name: Verify OpenAdapt Seal offline + id: verify + shell: bash + env: + ACTION_PATH: ${{ github.action_path }} + INSTALL_MODE: ${{ inputs.install-mode }} + INPUT_RECEIPT: ${{ inputs.receipt }} + INPUT_PUBLIC_KEY: ${{ inputs.public-key }} + INPUT_KEYS: ${{ inputs.keys }} + INPUT_KEY_ROLE: ${{ inputs.key-role }} + INPUT_OPENINGS: ${{ inputs.openings }} + INPUT_ACCEPTED_OUTCOMES: ${{ inputs.accepted-outcomes }} + INPUT_ALLOW_DEMO: ${{ inputs.allow-demo }} + run: | + set -euo pipefail + LOCAL_TYPES="${ACTION_PATH}/../../../packages/types" + if [ "$INSTALL_MODE" = "auto" ] && [ -f "${LOCAL_TYPES}/pyproject.toml" ]; then + export PYTHONPATH="${LOCAL_TYPES}${PYTHONPATH:+:${PYTHONPATH}}" + fi + EXTRA_ARGS=() + if [ "${INPUT_ALLOW_DEMO}" = "true" ]; then + EXTRA_ARGS+=(--allow-demo) + fi + python "${ACTION_PATH}/verify_seal.py" \ + --receipt "${INPUT_RECEIPT}" \ + --public-key "${INPUT_PUBLIC_KEY}" \ + --keys "${INPUT_KEYS}" \ + --key-role "${INPUT_KEY_ROLE}" \ + --openings "${INPUT_OPENINGS}" \ + --accepted-outcomes "${INPUT_ACCEPTED_OUTCOMES}" \ + "${EXTRA_ARGS[@]}" diff --git a/.github/actions/verify-seal/requirements.txt b/.github/actions/verify-seal/requirements.txt new file mode 100644 index 0000000000..bbae0f4b56 --- /dev/null +++ b/.github/actions/verify-seal/requirements.txt @@ -0,0 +1,332 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile --generate-hashes --universal --python-version 3.12 - +annotated-types==0.8.0 \ + --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ + --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 + # via pydantic +cffi==2.1.1 ; platform_python_implementation != 'PyPy' \ + --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ + --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ + --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \ + --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ + --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ + --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ + --hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \ + --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ + --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ + --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ + --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ + --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ + --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ + --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ + --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ + --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ + --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \ + --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ + --hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ + --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ + --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ + --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ + --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ + --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ + --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ + --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ + --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ + --hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \ + --hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \ + --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ + --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ + --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ + --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ + --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ + --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ + --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ + --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \ + --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ + --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ + --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ + --hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \ + --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ + --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ + --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ + --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ + --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ + --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ + --hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \ + --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ + --hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \ + --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ + --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ + --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ + --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ + --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ + --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ + --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ + --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ + --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \ + --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ + --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \ + --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ + --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ + --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ + --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ + --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ + --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ + --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ + --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ + --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ + --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ + --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \ + --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ + --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 + # via cryptography +cryptography==50.0.2 \ + --hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \ + --hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \ + --hash=sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047 \ + --hash=sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c \ + --hash=sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42 \ + --hash=sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18 \ + --hash=sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51 \ + --hash=sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81 \ + --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 \ + --hash=sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2 \ + --hash=sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de \ + --hash=sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7 \ + --hash=sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd \ + --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 \ + --hash=sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be \ + --hash=sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45 \ + --hash=sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0 \ + --hash=sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e \ + --hash=sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c \ + --hash=sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5 \ + --hash=sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452 \ + --hash=sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48 \ + --hash=sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05 \ + --hash=sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1 \ + --hash=sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93 \ + --hash=sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04 \ + --hash=sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e \ + --hash=sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67 \ + --hash=sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7 \ + --hash=sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107 \ + --hash=sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079 \ + --hash=sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134 \ + --hash=sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227 \ + --hash=sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1 \ + --hash=sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539 \ + --hash=sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e \ + --hash=sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d \ + --hash=sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c \ + --hash=sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd \ + --hash=sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020 \ + --hash=sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd \ + --hash=sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94 \ + --hash=sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a \ + --hash=sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408 \ + --hash=sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37 \ + --hash=sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e \ + --hash=sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454 \ + --hash=sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c \ + --hash=sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc \ + --hash=sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37 \ + --hash=sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767 \ + --hash=sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a \ + --hash=sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5 \ + --hash=sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc \ + --hash=sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67 \ + --hash=sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8 \ + --hash=sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480 \ + --hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \ + --hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b +openadapt-types==0.24.0 \ + --hash=sha256:16dcd1da1c2c78c08d650a19eb9cc439474f996812a87198b316d51bfac443db \ + --hash=sha256:8025e8a4dc9235fd81d4b24ae7fa7e544120abdb8d4ee7df160e4f50d9230d75 +pycparser==3.12 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \ + --hash=sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e \ + --hash=sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6 + # via cffi +pydantic==2.14.4 \ + --hash=sha256:653a2ad9f6d8858529c77c72717d0ea991d6c6837fe683246b2f4b2bbfc3fadc \ + --hash=sha256:7c19f1d46f8accf55a4617a6116e1ade64840870f397b846a2c53fb9019414ba + # via openadapt-types +pydantic-core==2.50.5 \ + --hash=sha256:004c784d4642bd1112a9fa9a022543aa17793fd32004f7e903ee97df2086bad4 \ + --hash=sha256:00598ae680c6e4a17cda01910e49c0da8ce15610505e6c57cec3f15d83daef88 \ + --hash=sha256:008de9d97f2b0c8e596fb5d93d49b63be158e8be5ac35856903b338cbcfd21f3 \ + --hash=sha256:041f4730fa7a8bf975e88436d439bdc72f3f16e584a470ffbe47392628d99de6 \ + --hash=sha256:05815bbe2c7bec58d1ce456cc0a98f368e6ef9345b1d9311f42b814d34ad7086 \ + --hash=sha256:07a62d44515d674d750cfd86b7ce1dd93111be870f378d7c27b37aeb78d0cb4a \ + --hash=sha256:09c732c097816c89d46ddb70f89d72e853e3a1bbac6475961c60a88aad9fe612 \ + --hash=sha256:0a7d599d0c5afbab98c0e4441f5b76163c6fcfd2ecf73dd6418e468a7ac452b8 \ + --hash=sha256:0c9f0002e4ec37db931e4ee8b7dafab2c7288ef66354e74fe16484e60eac6616 \ + --hash=sha256:0d4edc3350e21e0ef773ef9395227ca072832f05e484cadcf4d8663b63a231c0 \ + --hash=sha256:0d6e614776c8c99495dcfc6ce8f826277fb4388a5e5cbee23c199cbe39e6dcb3 \ + --hash=sha256:0dd037d96e98f6db8b69a44ab7d5c20a07fb0a2051775746a9e1b5fc8f52867f \ + --hash=sha256:11806d9b4888f1645d74fc24237f21dad559b42fb8930481b3df414997be6ee5 \ + --hash=sha256:12178e58af383bd4c32b2fe141188bc7e540c5eb33ad550856fa5863b4c31bd5 \ + --hash=sha256:15124b48e0acb6d24664690e052d50be51901286886bc124090960f1df869f30 \ + --hash=sha256:159f6bc1b616e0ca0938eb568d87ca03c633d6f06306ac47b9c3e5dd8c14d39a \ + --hash=sha256:1793ec63c8f247131aa4dfc8c4da645b9c5872cf26b53ce240f143f59ad116e4 \ + --hash=sha256:1d53befcfd415bd9212e685372c825e62f29b83820db78512c9d3659f13d29e9 \ + --hash=sha256:1deb966176b1b66be4281c83f10a0b6b1cecedeb25f53ee894bf27b22376facd \ + --hash=sha256:1e740886083ff95530d694e6a3f09ed914bcf92a496d16acd307c6c3484fc36d \ + --hash=sha256:1f22c36d952f33bac936273ca0be115693a1d7c1c9496ca7d699e6a338656d6e \ + --hash=sha256:20337f547d79911457cd4739bb6699213a53089f946af87633a48fad3f74f5e1 \ + --hash=sha256:22f5f0c37251611191a55e801a5150aa21f348fa10eac8eac9fa43c29937a7b1 \ + --hash=sha256:24d23de96195ff9637e5940a7fbde3bea6a355b26fb5f491737dd803aa5d5a93 \ + --hash=sha256:252ce30d79b47954cc3a49f8a0d812ac24a356627391fcec90a68733c755707e \ + --hash=sha256:27bc22dc8d50335bc62296261a7dc4c2572149910ba7c274ef0f945b5be0d570 \ + --hash=sha256:2cb80e0323b31d4669c4d72a466d99c885e13deb06205aa079ea6594e7ad1ef8 \ + --hash=sha256:2d785ae9ff0ac485567f27f4fc53712268916e04be4a590160e5bf55b096225a \ + --hash=sha256:2f0a86887c644247eff4cc7b9e609042a49833dcd72f84574e7b8beea89729ab \ + --hash=sha256:2f5f29ff80ce0cf93102198cddebdbb3411881de177359c770e5c9c99495a6b3 \ + --hash=sha256:2f6a8c9b8647378c0dc128805e6b98da39d36019a0e7cac134badeaedb14f849 \ + --hash=sha256:302517f9f5589e07ead02d38fbb443947a211461b39b18f46948b20941fa8d98 \ + --hash=sha256:30988977d38909df645183a9869a9d12211485639ac4757de18585f0ccb6f3dc \ + --hash=sha256:3129b52ee2861d0270db8bd140fc9b53ee9821247ca47fda2613a899ce9a1ea3 \ + --hash=sha256:372f4ab3e67b2387871950cfa27d94d644c3475e650836ea52e25c2e4fbd7975 \ + --hash=sha256:3cf575867ecaf89aca440e5a4253d2facf1ca37bab30a4e8c205ec611228126a \ + --hash=sha256:3f800fc0f304f3b0e09d07d4287f9f0bc9bfe5319d1d7cabeaf265737c516083 \ + --hash=sha256:40d5da89a632e6c6c938f93fdf54c534882d258a80f51ccfe1650cdedc12e82c \ + --hash=sha256:43917f090dfda561575a72f75814f76a0680964b70d7b44c84e44d217bdeade7 \ + --hash=sha256:43a6eaee9eeac4a54f2ff6567e1b0ec51651b37a40d862cab2e6fd16109e6528 \ + --hash=sha256:44e6c35bf3a9b6785db0c083df8a6929343f9c8fc27186991d21653242c77c19 \ + --hash=sha256:470bbc2495367f60d3ca849a8039e4c164701d10637e7743f4427d92651bdb6d \ + --hash=sha256:47f4d79fe4876feace216a5b2263c40d792476b4a6508c38d66a2facd3f1f4cc \ + --hash=sha256:488319076ec92908b91fc6265ce761f1d78748f69f85518564fd16bf333e1b70 \ + --hash=sha256:4888829471cd8d85c096ef0e1f41a066c7d76e88309a4fbff4069f70d07673be \ + --hash=sha256:48b5deaaee4f1b99603173cd291127523e43ee9f51db58c7ff98d16dc5c6fc93 \ + --hash=sha256:4ac243e358837f62d085f07b98625fa3831abdb28e8f77196934345bbff0fb0b \ + --hash=sha256:4ae5c9f84dfa43643d10328a212f709c7602c5e70df376d217ae5770d374ccd9 \ + --hash=sha256:4dcf7b2cdfb9c59c1d377de318f3c8462121f32db939299999484ea0b1eadf18 \ + --hash=sha256:5027c263fbceb821cfb4b385d36d485e19efca1d9adcc4e5bec69c04ca3cdc83 \ + --hash=sha256:50d12ba7cab98b355ba65d65655e969f66934ab7a3d2d0c8abd61ae2282efce5 \ + --hash=sha256:5274f8314ce3be1df07ae8ebceeb97a73b8409d842fd7677c5d0a85a68793ec1 \ + --hash=sha256:55e0d60384a9b14641749d2ba6721f82409248288f066b95d555c6dd484273d2 \ + --hash=sha256:568e928322f0b6b94671fc1a4dbc867627af74695b0c060ac6d4f25b6a7425d8 \ + --hash=sha256:57b79401d870c9df395799c596d81875b647ecf3030129d86659a54f6bfcc0db \ + --hash=sha256:57d4350167130c9c136b7efa35e6e7ee9539779698755b01007834d32c7a1f7d \ + --hash=sha256:5da0e7da9d7cdc39df85d1b927b77d40218cf40acbfc523048c95ce44d33abb9 \ + --hash=sha256:5eafde2cd1d97b7f60efc423d8504b22defd9d2fb9c4a358ffd1230e5fe65311 \ + --hash=sha256:5ec2e8caf5eadea7be683fc7025d60563e920f1f52fe18ae46c49558e67b8cd0 \ + --hash=sha256:5f33c92da4aa5714fb6fcb086358274598e8ff62b6607afd132a38657aa64f02 \ + --hash=sha256:639a51931869c0594d8723b2f529c547db1aa33dc9571d001dc205d896170c08 \ + --hash=sha256:63a0ba0d7ccf37c8c724bb7ed13c3aa0aa4c743f4f5f376c92c47e584844c7b1 \ + --hash=sha256:655d0cc2ddbc3fb1f4f8a8e3724552ee2ba6b8561289e9e6e06186982b27bceb \ + --hash=sha256:65b0f52abcd06dbb53961db9cc3610929f4f6518c3726d965a9babdaf7bd79c9 \ + --hash=sha256:679f15dd3bd2a82bde350ec8c94c0f8f05f05dba39fb3464cd4136a724da9844 \ + --hash=sha256:68334f281460fb2a85bbb9e2545438bf2fd2c9a166823a60b84541a3c8f2d2e0 \ + --hash=sha256:6a069ceeca397bd8da2e8ef6383595c63ea17de37d5f2d5cde729bdc0dfe6774 \ + --hash=sha256:6e01a2033691ea2cbd91e499d6b6573f446dc926ccdfc670ed576991cef85cdb \ + --hash=sha256:706c75cd9f8bd1798367f463ea81df52eff5fb2e4c4ef83997dd4ae538adc109 \ + --hash=sha256:71633f82d51d4796a48026bd6eca5ec83e4a0edbe6187d59bbc45ace1111ebae \ + --hash=sha256:736782cfbca37b4d81e6f3c7a3414de25db045dcdb7a05e55b64191a33c5ac45 \ + --hash=sha256:7c3faea08d44b4a7b57b30f1113e6404e6aa62a4f3489a22359fb27d6003d8b1 \ + --hash=sha256:7dfc0431e94659ae8449303ca4fb1588dc1e00282d6636d00d72bb4bd6459b4d \ + --hash=sha256:851a78a30265bb203186fd0e19712c1a4431083eb5a1e1715f758a029cd8aa6e \ + --hash=sha256:86bd5aad5ccbaced98139d08b4314f253c086897830f4bcf9c1d1f02f740683d \ + --hash=sha256:887424ba7c2145e97f131bc2cc73383a8c464d7bcd56eb98bbd941afb6868b95 \ + --hash=sha256:88b543705849d0c59343f97c38296dbf59eb7b3c9565bd4fe1ed638ba38da5ed \ + --hash=sha256:8ba2dcbeea0ab8836e804c54e905075125c702cf78e592d998eecf2764b64144 \ + --hash=sha256:8bbe282e79dc71b24ba7be284eacf27c8ddff8f26911e2030a0dd123c6aed326 \ + --hash=sha256:8c7244134b93ce028e9166c1b5d3e4537349307ccf3e65d746b4c6b1bbed8c89 \ + --hash=sha256:90dabbf4f38f37de1663ce932d37c6f694a005f6470ae2f0d97755d9e3f90ffd \ + --hash=sha256:90ff55049623eccbfa997332e2b91358dc2c4c30ca6e664b45438723cbe181df \ + --hash=sha256:922455cc5baddb0f2c82b7ba649e57e89183442b32fe512670db6ebb9b66b251 \ + --hash=sha256:92c0ebab606f982730aaaa741a30cd5e0f68dc7c005a5baa9b332fc182232c61 \ + --hash=sha256:93a10c0b967c0dc6c2253d3a82b9117d2a841b8e344c637edc0a14220852b115 \ + --hash=sha256:93ee3b4f9c64fb1c39892413c4196d0a84790a7e0e5d72b463882c432c1ffafe \ + --hash=sha256:98b92dad690e6578cc0b504eda53d53adaa4f34bd09c97a547a957e419544eb7 \ + --hash=sha256:9e255e7c32d9c2f396d3daa833e7d8d701eec7bf8e13ca092b4b83ce7d9487fd \ + --hash=sha256:9f2bf218dbc93363fe3e31cc53d36db8d6ff4122179406bec05f33bb79c0e2c1 \ + --hash=sha256:a5f6622451fa3cd71c8ff15df24307cb3f8b5dc35a723de281646c34872d7179 \ + --hash=sha256:a9bcf23628860d5a90cacdc188ee3b7d0547a38eb985214f03e7002a6ca0e558 \ + --hash=sha256:aa69eaeed433cfe5de809fb84c95536a5aed991b28290d0db059fe6766c69274 \ + --hash=sha256:ad0e0221deec2a2385300d76b9259da7036c0ed784502c154ae237dafd67605f \ + --hash=sha256:af453c0c20372ca8acf3c46de2a89b242491853dc61d0171ba24608d33310e09 \ + --hash=sha256:b2910ec0fa5aeb9bef70156f2b79f4783978fdcfaa7b2f1b5d1814458d2e79a1 \ + --hash=sha256:b2b64d3204f9c33f03ed3111eb754902ea76ca5aa61ab4b2bdf9f767a4a1f279 \ + --hash=sha256:b43115385de7db83bd2fe7a08dea8580bce3acc3f54200c4f4fe32a4a49688d4 \ + --hash=sha256:b66f2434c895652ac21c030d5a3a92c7811f0f9b98af41bf35be899c2d34aa4c \ + --hash=sha256:b6f48c4bf1c77ace644b125f168418438fbc9b8e4c3b290915cc7d055d83c8b1 \ + --hash=sha256:b7e6a76b77513cd633a08addfda8409623ad884a4d91ee3664fb05cf094b2c35 \ + --hash=sha256:b9348cfd798b8199d34da5258becf2fc8f5e4e7a3b51da30c34b81b996a07b34 \ + --hash=sha256:ba2b34529984a8e3cb1bc62a7687617722695a2cb4e57958de32a0eba128a07a \ + --hash=sha256:baa107902f8e38011a5f79836d905eb6bfaac1d4b0bd09fc86509b711d0b09c8 \ + --hash=sha256:bb103c150e1a0f1b8b2710a66ce1f741c7922b22ef07a290aea0e6cf702d8bbf \ + --hash=sha256:bcc830e4f48499fd30a870f07c30752273ae2ddccce34d65d51c9fc880c380ab \ + --hash=sha256:bcd9d9b38e61dfd43e00f621ce00da2ffed35047fad532c4afcadf4f9ca0d672 \ + --hash=sha256:bdafd6b05bf012772b7d7325a98d26f19b7918e21dabdd5970c885262245aae3 \ + --hash=sha256:be4615d4b5f90c65dce2295dcf32eff7f05ea5d0d3a82421c03c572785cb9bf8 \ + --hash=sha256:c334b8759496f9e597b68e1309b2fb3d824fd24a29e562afa86b61005eb9d54d \ + --hash=sha256:c415a8da7c89a3dd32d988a9117bf0a52371769b77b0943bcfd50b281ecefb8d \ + --hash=sha256:c4c4313dc66f45822b3d7f39aa74e59e7987cf7572b3309005b26d956a0098a9 \ + --hash=sha256:c69eb2e09d2830949e6e8f395d4eb8c714ba083213ccff64932ded681fe69a4e \ + --hash=sha256:cbec4aad328be58961c738b83fc2c7bd993242d2366f949d914e8c09266dee0e \ + --hash=sha256:cbfde3ad127786f1dea1a6cd89a5eb824a16203f24743ad2b4e07506f43bc844 \ + --hash=sha256:d16cb794449c2bc0e5cb0ab0022813419bf5283266f2a7ff1fc54e5c6e27dcee \ + --hash=sha256:d34c0d4dd4a318f2be788a60a972c3a1ed5da0155a7c06d6dd810dc5d60ad704 \ + --hash=sha256:d3ada66d0601feeeba504a6daac73e47ed164357e46930366f135c4121594d53 \ + --hash=sha256:d4ebf349b1b60049e80df5d9ea6725b1b7e434a7d006474b0f664fa72a6b3c75 \ + --hash=sha256:d7826407ed74ff8e6cc6e6df7ffbf180e9b449ab1516f28eb5f6e2a489bc5129 \ + --hash=sha256:d84b427c6badf48adc2586be1dc5c8677fc2f22a09da50e5d3f342d3daf3b2b4 \ + --hash=sha256:dac78f91e263c4c9a4d587b9d97b3b5b2561293b33247452cc3cfe5b500e8cfb \ + --hash=sha256:dc5717ed8981efdbbafc15a2533a690703cf80e96b886a158c61c9ec9bafcc28 \ + --hash=sha256:e0a7ae307b4e1eff195cd23a757da07f70a115e45175039caf5f3979a20c7edb \ + --hash=sha256:e5d5d77a9446f44688a5ef420d92c9facac0865ef5565215db54be184ab7906f \ + --hash=sha256:e65f78eb3d930ac30ff3557fc74a0771300096fb002f588a6fe8d946e83f14ad \ + --hash=sha256:e7dd59f498ef42077f22db607571249db41997227018cb84644ba0059f8b5719 \ + --hash=sha256:e8faa73de2e9231f604cfa44c471d0986e7e9c45129d7888839a34196e46a7df \ + --hash=sha256:e8fe516a4b3b06e4ff83b9adee4a786d28a617e5fb5fe90bda49fb6f52a5ac19 \ + --hash=sha256:e93587aaa5660536b9188686e8fe0544b577ec57d896d424b5b2118b151a6845 \ + --hash=sha256:ea215f7f5d2df866e3b5448c0bbb4a35285086ac6ab18687796704cbd5f2c5a3 \ + --hash=sha256:ea7429e3adb2f2fd81e2d6e8942e5c1cd760a6e6be5b7574d2ee5499b5e19e67 \ + --hash=sha256:ed4a01922af0d41b2a3b9433818cbb73b6b28e8dea344c90917c1fdcceb9960f \ + --hash=sha256:ef461e9299ae665fab67c6f054847178b8fd510da10b4ef745a074b922efbf0a \ + --hash=sha256:f20c692c599ebac7f04f3a0102b969f3f9d6667ffe1e72629fc7fbf8b6375234 \ + --hash=sha256:f33be114a0ee27870cffd31057ed60bf5a0cd522dcbdc1dda0bdad70f8302cb0 \ + --hash=sha256:f7509c6f8a0f9d9eac58340dd567f0eb71ce2f762df09f0d51280e30da3fe687 \ + --hash=sha256:f8dc2008577c5e02eaa1eb3fbfa8fe0eba9af27ff6a740e9f1dae6661e88efcb \ + --hash=sha256:f8fd7e9c44bb4c9214d41c3bef79cba5a513b29c3bcbfdaaf0440ca6f5fb65ea \ + --hash=sha256:fa66340c6d3e08a276803812e7665312dfc75dd24eedfa8e09f18a0f8e3e0e8f \ + --hash=sha256:feb8c87dbc4684777ddafbf37c922d9e2748272ba61e362ebf85db73ebda6234 + # via pydantic +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # pydantic + # pydantic-core + # typing-inspection +typing-inspection==0.4.5 \ + --hash=sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7 \ + --hash=sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39 + # via pydantic diff --git a/.github/actions/verify-seal/verify_seal.py b/.github/actions/verify-seal/verify_seal.py new file mode 100644 index 0000000000..3171a12be3 --- /dev/null +++ b/.github/actions/verify-seal/verify_seal.py @@ -0,0 +1,355 @@ +#!/usr/bin/env python3 +"""Offline cryptographic verifier for the OpenAdapt Seal GitHub Action. + +Performs zero network egress and fails closed (exit code 1) on any missing +receipt, missing/unknown signing key, malformed JSON, or invalid/tampered +Ed25519 signature. Writes outputs to ``$GITHUB_OUTPUT`` and a Markdown summary +table to ``$GITHUB_STEP_SUMMARY`` when those environment variables are set. +""" + +from __future__ import annotations + +import argparse +import base64 +import os +import shlex +import sys +from pathlib import Path +from typing import Any, Optional + +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey +from openadapt_types.receipt import ( + REGISTRY_SCHEMA, + ROLES, + RoleKey, + key_id, + loads_strict, + parse_registry, + verify_receipt, +) + +_ALLOWED_ROLES = frozenset(ROLES) + + +def _sanitize_output(value: str) -> str: + """Ensure a single-line value safe for GITHUB_OUTPUT key=value syntax.""" + return " ".join(str(value).splitlines()).strip() + + +def _escape_md_cell(value: str) -> str: + """Escape characters that could break a GitHub-Flavored Markdown table cell.""" + return _sanitize_output(value).replace("|", "\\|") + + +def _write_github_outputs( + *, + verified: bool, + receipt_id: str, + outcome: str, + reason: str, +) -> None: + out_path = os.environ.get("GITHUB_OUTPUT", "").strip() + if not out_path: + return + lines = [ + f"verified={'true' if verified else 'false'}", + f"receipt-id={_sanitize_output(receipt_id)}", + f"outcome={_sanitize_output(outcome)}", + f"reason={_sanitize_output(reason)}", + ] + with Path(out_path).open("a", encoding="utf-8") as fh: + fh.write("\n".join(lines) + "\n") + + +def _write_step_summary(markdown: str) -> None: + summary_path = os.environ.get("GITHUB_STEP_SUMMARY", "").strip() + if not summary_path: + return + with Path(summary_path).open("a", encoding="utf-8") as fh: + fh.write(markdown.rstrip() + "\n") + + +def _load_public_key_or_registry(path: Path, role: str) -> list[RoleKey]: + if not path.is_file(): + raise ValueError(f"public key file not found: {path}") + raw = path.read_bytes() + text = raw.decode("utf-8", errors="replace").strip() + if text.startswith("{"): + parsed = loads_strict(text) + if not isinstance(parsed, dict) or parsed.get("schema") != REGISTRY_SCHEMA: + raise ValueError(f"JSON key file is not an {REGISTRY_SCHEMA} registry") + return parse_registry(parsed) + if role not in _ALLOWED_ROLES: + raise ValueError( + f"unsupported key-role {role!r}; expected one of {sorted(_ALLOWED_ROLES)}" + ) + loaded = serialization.load_pem_public_key(raw) + if not isinstance(loaded, Ed25519PublicKey): + raise ValueError("public-key PEM must be an Ed25519 public key") + raw_pub = loaded.public_bytes( + encoding=serialization.Encoding.Raw, + format=serialization.PublicFormat.Raw, + ) + return [ + RoleKey( + key_id=key_id(raw_pub), + public_key=base64.b64encode(raw_pub).decode("ascii"), + role=role, + status="active", + ) + ] + + +def _extract_receipt_id(statement: Optional[dict[str, Any]]) -> str: + if not isinstance(statement, dict): + return "" + predicate = statement.get("predicate") + if isinstance(predicate, dict): + for field in ("run_id", "receipt_id"): + val = predicate.get(field) + if isinstance(val, str) and val.strip(): + return val.strip() + subjects = statement.get("subject") + if isinstance(subjects, list) and subjects: + first = subjects[0] + if isinstance(first, dict): + digest = first.get("digest") + if isinstance(digest, dict) and isinstance(digest.get("sha256"), str): + return f"sha256:{digest['sha256'][:16]}" + return "" + + +def _fail( + *, + receipt_arg: str, + reason: str, + detail: str, + receipt_id: str = "", + outcome: str = "", +) -> int: + _write_github_outputs( + verified=False, + receipt_id=receipt_id, + outcome=outcome, + reason=reason, + ) + summary = ( + "### ❌ OpenAdapt Seal Verification Failed\n\n" + "| Field | Value |\n" + "| --- | --- |\n" + "| **Status** | Refused (fail-closed) |\n" + f"| **Reason** | `{_escape_md_cell(reason)}` |\n" + f"| **Detail** | {_escape_md_cell(detail)} |\n" + f"| **Receipt** | `{_escape_md_cell(receipt_arg)}` |\n" + ) + if outcome: + summary += f"| **Run Outcome** | `{_escape_md_cell(outcome)}` |\n" + _write_step_summary(summary) + print(f"OpenAdapt Seal verification FAILED ({reason}): {detail}", file=sys.stderr) + return 1 + + +def verify_seal_cli(argv: Optional[list[str]] = None) -> int: + parser = argparse.ArgumentParser( + prog="verify-seal", + description="Offline cryptographic verification of an OpenAdapt receipt.", + allow_abbrev=False, + ) + parser.add_argument("--receipt", required=True, help="Path to receipt JSON file.") + parser.add_argument( + "--public-key", + default="", + help="Optional path to an Ed25519 PEM public key or receipt-keys/v1 JSON.", + ) + parser.add_argument( + "--keys", + default="", + help="Optional path to an openadapt.receipt-keys/v1 JSON registry.", + ) + parser.add_argument( + "--key-role", + default="this_computer", + help="Role assigned to a raw PEM public key (default: this_computer).", + ) + parser.add_argument( + "--openings", + default="", + help="Optional path to receipt.private.json openings sidecar.", + ) + parser.add_argument( + "--accepted-outcomes", + default="VERIFIED", + help=( + "Comma-separated list of accepted receipt outcomes " + "(default: VERIFIED). Any other outcome fails closed." + ), + ) + parser.add_argument( + "--allow-demo", + action="store_true", + help="Allow receipts signed only by a demo-role key (default: refuse).", + ) + args = parser.parse_args(argv) + + receipt_arg = args.receipt.strip() + if not receipt_arg: + return _fail( + receipt_arg="", + reason="missing_receipt", + detail="receipt input path is empty", + ) + receipt_path = Path(receipt_arg) + if not receipt_path.is_file(): + return _fail( + receipt_arg=receipt_arg, + reason="missing_receipt", + detail=f"receipt file not found: {receipt_path}", + ) + + registry: list[RoleKey] = [] + try: + if args.public_key.strip(): + registry.extend( + _load_public_key_or_registry( + Path(args.public_key.strip()), + args.key_role.strip() or "this_computer", + ) + ) + if args.keys.strip(): + keys_path = Path(args.keys.strip()) + if not keys_path.is_file(): + raise ValueError(f"keys registry file not found: {keys_path}") + registry.extend( + parse_registry(loads_strict(keys_path.read_text(encoding="utf-8"))) + ) + except Exception as exc: # noqa: BLE001 - fail closed on any key/registry error + return _fail( + receipt_arg=receipt_arg, + reason="invalid_key_material", + detail=str(exc), + ) + + if not registry: + return _fail( + receipt_arg=receipt_arg, + reason="no_trusted_keys", + detail="no trusted public-key or keys registry supplied; refusing fail-closed", + ) + + try: + document = loads_strict(receipt_path.read_text(encoding="utf-8")) + if not isinstance(document, dict): + raise ValueError("receipt JSON must be an object") + except Exception as exc: # noqa: BLE001 - fail closed on malformed receipt + return _fail( + receipt_arg=receipt_arg, + reason="malformed_receipt", + detail=str(exc), + ) + + openings_doc: Optional[dict[str, Any]] = None + if args.openings.strip(): + openings_path = Path(args.openings.strip()) + if not openings_path.is_file(): + return _fail( + receipt_arg=receipt_arg, + reason="missing_openings", + detail=f"openings file not found: {openings_path}", + ) + try: + loaded_openings = loads_strict(openings_path.read_text(encoding="utf-8")) + if not isinstance(loaded_openings, dict): + raise ValueError("openings JSON must be an object") + openings_doc = loaded_openings + except Exception as exc: # noqa: BLE001 + return _fail( + receipt_arg=receipt_arg, + reason="malformed_openings", + detail=str(exc), + ) + + result = verify_receipt(document, registry, openings=openings_doc) + if not result.ok: + return _fail( + receipt_arg=receipt_arg, + reason=str(result.reason or "verification_failed"), + detail=result.detail + or "; ".join(result.signer_lines) + or "signature check failed", + ) + + receipt_id = _extract_receipt_id(result.statement) + outcome = (result.outcome or "").strip() + accepted_outcomes = { + tok.strip().upper() + for tok in args.accepted_outcomes.split(",") + if tok.strip() + } + if not accepted_outcomes: + return _fail( + receipt_arg=receipt_arg, + reason="invalid_accepted_outcomes", + detail="accepted-outcomes must name at least one outcome (e.g. VERIFIED)", + receipt_id=receipt_id, + outcome=outcome, + ) + if result.demo and not args.allow_demo: + return _fail( + receipt_arg=receipt_arg, + reason="demo_signer_rejected", + detail=( + "receipt is signed only by a demo-role key; pass --allow-demo " + "to accept demo receipts" + ), + receipt_id=receipt_id, + outcome=outcome, + ) + if not outcome or outcome.upper() not in accepted_outcomes: + allowed_display = ", ".join(sorted(accepted_outcomes)) + return _fail( + receipt_arg=receipt_arg, + reason="outcome_not_accepted", + detail=( + f"receipt signature is valid but run outcome {outcome or ''!r} " + f"is not in accepted outcomes ({allowed_display})" + ), + receipt_id=receipt_id, + outcome=outcome, + ) + + signer_summary = "; ".join(result.signer_lines) or "Valid Ed25519 signature" + offline_cmd = f"openadapt verify {shlex.quote(receipt_arg)}" + if args.keys.strip(): + offline_cmd += f" --keys {shlex.quote(args.keys.strip())}" + + _write_github_outputs( + verified=True, + receipt_id=receipt_id, + outcome=outcome, + reason="", + ) + summary = ( + "### ✅ Verified by OpenAdapt Seal\n\n" + "| Field | Value |\n" + "| --- | --- |\n" + "| **Status** | Verified offline (Ed25519) |\n" + f"| **Receipt ID** | `{_escape_md_cell(receipt_id or 'n/a')}` |\n" + f"| **Run Outcome** | `{_escape_md_cell(outcome or 'n/a')}` |\n" + f"| **Ed25519 Signature** | {_escape_md_cell(signer_summary)} |\n" + f"| **Offline Verification** | `{_escape_md_cell(offline_cmd)}` |\n" + ) + _write_step_summary(summary) + print( + f"Verified by OpenAdapt Seal: receipt-id={receipt_id or 'n/a'} " + f"outcome={outcome or 'n/a'} ({signer_summary})" + ) + return 0 + + +def main() -> None: + raise SystemExit(verify_seal_cli()) + + +if __name__ == "__main__": + main() diff --git a/tests/test_verify_seal_action.py b/tests/test_verify_seal_action.py new file mode 100644 index 0000000000..53feabcb2c --- /dev/null +++ b/tests/test_verify_seal_action.py @@ -0,0 +1,299 @@ +"""Tests for the .github/actions/verify-seal composite GitHub Action.""" + +from __future__ import annotations + +import importlib.util +import json +import sys +from pathlib import Path +from typing import Any + +import pytest + +pytest.importorskip("cryptography") + +ROOT = Path(__file__).resolve().parents[1] +ACTION_DIR = ROOT / ".github" / "actions" / "verify-seal" +SCRIPT_PATH = ACTION_DIR / "verify_seal.py" +ACTION_YML = ACTION_DIR / "action.yml" +VECTORS = ROOT / "packages" / "types" / "tests" / "vectors" / "record-run-v1" + + +def _ensure_in_tree_types() -> None: + types_dir = str(ROOT / "packages" / "types") + if types_dir not in sys.path: + sys.path.insert(0, types_dir) + pkg = sys.modules.get("openadapt_types") + if pkg is not None and hasattr(pkg, "__path__"): + in_tree_pkg = str(ROOT / "packages" / "types" / "openadapt_types") + if in_tree_pkg not in pkg.__path__: + pkg.__path__.insert(0, in_tree_pkg) + + +def _load_module() -> Any: + _ensure_in_tree_types() + spec = importlib.util.spec_from_file_location("verify_seal_action", SCRIPT_PATH) + assert spec is not None and spec.loader is not None + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + +def _parse_outputs(path: Path) -> dict[str, str]: + out: dict[str, str] = {} + for line in path.read_text(encoding="utf-8").splitlines(): + if "=" in line: + k, v = line.split("=", 1) + out[k] = v + return out + + +def _make_signed_receipt( + tmp_path: Path, *, outcome: str | None = None +) -> tuple[Path, Path, dict[str, Any]]: + """Sign a valid record/run/v1 statement with a fresh Ed25519 keypair.""" + from cryptography.hazmat.primitives import serialization + from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey + + _ensure_in_tree_types() + from openadapt_types import receipt as r + + priv = Ed25519PrivateKey.generate() + pub = priv.public_key() + raw_pub = pub.public_bytes( + encoding=serialization.Encoding.Raw, + format=serialization.PublicFormat.Raw, + ) + pem_pub = pub.public_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PublicFormat.SubjectPublicKeyInfo, + ) + pub_path = tmp_path / "public-key.pem" + pub_path.write_bytes(pem_pub) + + # Reuse the canonical valid statement from the shared vector set. + valid_vec = json.loads((VECTORS / "valid.json").read_text(encoding="utf-8")) + import base64 + + statement = json.loads( + base64.b64decode(valid_vec["document"]["payload"]).decode("utf-8") + ) + if outcome is not None: + statement["predicate"]["outcome"] = outcome + envelope = r.sign_statement(statement, [(r.key_id(raw_pub), priv.sign)]) + receipt_path = tmp_path / "receipt.json" + receipt_path.write_text(json.dumps(envelope, indent=2), encoding="utf-8") + return receipt_path, pub_path, envelope + + +def test_valid_receipt_with_pem_key_passes_and_writes_summary( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, pub_path, _ = _make_signed_receipt(tmp_path) + out_file = tmp_path / "github_output.txt" + summary_file = tmp_path / "github_summary.md" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_file)) + + rc = mod.verify_seal_cli( + ["--receipt", str(receipt_path), "--public-key", str(pub_path)] + ) + assert rc == 0 + + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "true" + assert outputs["outcome"] != "" + assert outputs["receipt-id"] != "" + assert outputs["reason"] == "" + + summary = summary_file.read_text(encoding="utf-8") + assert "✅ Verified by OpenAdapt Seal" in summary + assert outputs["receipt-id"] in summary + assert outputs["outcome"] in summary + assert "Ed25519" in summary + assert "openadapt verify" in summary + + +def test_valid_receipt_with_registry_json_passes( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + valid_vec = json.loads((VECTORS / "valid.json").read_text(encoding="utf-8")) + receipt_path = tmp_path / "vector_valid.json" + receipt_path.write_text(json.dumps(valid_vec["document"]), encoding="utf-8") + out_file = tmp_path / "github_output.txt" + summary_file = tmp_path / "github_summary.md" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_file)) + + rc = mod.verify_seal_cli( + [ + "--receipt", + str(receipt_path), + "--public-key", + str(VECTORS / "registry.json"), + ] + ) + assert rc == 0 + assert _parse_outputs(out_file)["verified"] == "true" + + +def test_tampered_receipt_fails_closed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, pub_path, envelope = _make_signed_receipt(tmp_path) + # Flip a byte in the base64 payload so the Ed25519 signature no longer verifies. + payload = envelope["payload"] + flipped = ("A" if payload[0] != "A" else "B") + payload[1:] + envelope["payload"] = flipped + receipt_path.write_text(json.dumps(envelope), encoding="utf-8") + + out_file = tmp_path / "github_output.txt" + summary_file = tmp_path / "github_summary.md" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_file)) + + rc = mod.verify_seal_cli( + ["--receipt", str(receipt_path), "--public-key", str(pub_path)] + ) + assert rc == 1 + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "false" + assert outputs["reason"] != "" + assert "❌ OpenAdapt Seal Verification Failed" in summary_file.read_text( + encoding="utf-8" + ) + + +def test_missing_receipt_fails_closed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + out_file = tmp_path / "github_output.txt" + summary_file = tmp_path / "github_summary.md" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_file)) + + rc = mod.verify_seal_cli(["--receipt", str(tmp_path / "does-not-exist.json")]) + assert rc == 1 + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "false" + assert outputs["reason"] == "missing_receipt" + + +def test_missing_trusted_keys_fails_closed( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, _, _ = _make_signed_receipt(tmp_path) + out_file = tmp_path / "github_output.txt" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + + rc = mod.verify_seal_cli(["--receipt", str(receipt_path)]) + assert rc == 1 + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "false" + assert outputs["reason"] == "no_trusted_keys" + + +def test_action_yml_pins_setup_python_and_avoids_script_injection() -> None: + text = ACTION_YML.read_text(encoding="utf-8") + assert "actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0" in text + assert "verify_seal.py" in text + # Inputs must flow through env vars, never directly interpolated inside run: blocks. + in_run = False + for line in text.splitlines(): + stripped = line.strip() + if stripped.startswith("run:"): + in_run = True + continue + if in_run and line and not line.startswith(" "): + in_run = False + if in_run: + assert "${{ inputs." not in line + + +@pytest.mark.parametrize("outcome", ["STOPPED", "FAILED", "UNKNOWN"]) +def test_signed_non_verified_outcome_fails_closed_by_default( + outcome: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, pub_path, _ = _make_signed_receipt(tmp_path, outcome=outcome) + out_file = tmp_path / "github_output.txt" + summary_file = tmp_path / "github_summary.md" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + monkeypatch.setenv("GITHUB_STEP_SUMMARY", str(summary_file)) + + rc = mod.verify_seal_cli( + ["--receipt", str(receipt_path), "--public-key", str(pub_path)] + ) + assert rc == 1 + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "false" + assert outputs["reason"] == "outcome_not_accepted" + assert outputs["outcome"] == outcome + assert "❌ OpenAdapt Seal Verification Failed" in summary_file.read_text( + encoding="utf-8" + ) + + +def test_signed_stopped_outcome_passes_when_explicitly_accepted( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, pub_path, _ = _make_signed_receipt(tmp_path, outcome="STOPPED") + out_file = tmp_path / "github_output.txt" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + + rc = mod.verify_seal_cli( + [ + "--receipt", + str(receipt_path), + "--public-key", + str(pub_path), + "--accepted-outcomes", + "VERIFIED,STOPPED", + ] + ) + assert rc == 0 + outputs = _parse_outputs(out_file) + assert outputs["verified"] == "true" + assert outputs["outcome"] == "STOPPED" + + +def test_demo_role_signer_fails_closed_unless_allow_demo( + tmp_path: Path, monkeypatch: pytest.MonkeyPatch +) -> None: + mod = _load_module() + receipt_path, pub_path, _ = _make_signed_receipt(tmp_path) + out_file = tmp_path / "github_output.txt" + monkeypatch.setenv("GITHUB_OUTPUT", str(out_file)) + + rc_refused = mod.verify_seal_cli( + [ + "--receipt", + str(receipt_path), + "--public-key", + str(pub_path), + "--key-role", + "demo", + ] + ) + assert rc_refused == 1 + assert _parse_outputs(out_file)["reason"] == "demo_signer_rejected" + + rc_allowed = mod.verify_seal_cli( + [ + "--receipt", + str(receipt_path), + "--public-key", + str(pub_path), + "--key-role", + "demo", + "--allow-demo", + ] + ) + assert rc_allowed == 0 + assert _parse_outputs(out_file)["verified"] == "true"