feat(cli): offline receipt verification with a local public key#833
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an offline verification path to
peac verify:--public-key <path>verifies a receipt JWS against a local public Ed25519 JWK or single-key JWKS with no network access. The existing network verification path is unchanged when the flag is omitted. Public surface change: adds the CLI flagpeac verify --public-key <path>. No package exports, wire format, schema, signing, or registry changes.Scope
packages/cli/src/index.ts(verify command option + offline branch)packages/cli/src/lib/public-key.ts(new key loader)packages/cli/tests/public-key.test.ts(new key-loader tests)packages/cli/tests/verify-public-key-cli.test.ts(new command wiring tests)Explicitly not changed:
verifyReceiptnetwork resolution,verifyLocalsemantics, any published package other than the CLI.Changes
peac verify <jws> --public-key <path>reads a bare public Ed25519 JWK or a single-key JWKS file and verifies viaverifyLocal(signature plus declared receipt structure), entirely offline.d), multi-key or empty JWKS, non-Ed25519 keys, and missing or malformedxvalues. Byte conversion reuses the canonicaljwkToPublicKeyBytesfrom@peac/crypto. Error messages never echo key material.Validation
E_INVALID_SIGNATURE(exit 1); a private-key file is rejected (exit 1); invalid samples fail closed (exit 1); omitting the flag exercises the unchanged network path.tsc --noEmit, Prettier, and whitespace checks pass.