Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d49730d2d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| let pubPem = pemFromB64(PUB_PEM_B64); | ||
| let pubSrc = pubPem ? "env-b64" : null; | ||
| let pubkeyBytes = PUB_KEY_TEXT ? parseEd25519PublicKeyText(PUB_KEY_TEXT) : null; |
There was a problem hiding this comment.
Preserve ENS fallback when local key text is invalid
/verify now parses RECEIPT_SIGNING_PUBLIC_KEY before attempting ENS lookup, so any malformed local key throws and returns a 500 even when ens=1 and ENS has a valid signature key. This regresses the prior behavior where a bad local key could be ignored and ENS-based verification could still succeed, so one misconfigured optional env var can take verification down in deployments that rely on ENS.
Useful? React with 👍 / 👎.
| if (!bytes.length || bytes.toString("base64") !== payload) { | ||
| throw new Error("invalid base64 in ed25519 public key"); |
There was a problem hiding this comment.
Accept unpadded base64 in ed25519 public key text
The validation requires bytes.toString("base64") === payload, which rejects otherwise valid unpadded base64 encodings (same 32-byte key, missing trailing =) that are commonly produced by tooling and manual ENS/env configuration. As written, valid ed25519:<base64> values can be rejected with invalid base64, causing unnecessary verification failures.
Useful? React with 👍 / 👎.
Motivation
cl.receipt.pubkey.pemlookups and signer_id indirection, and standardize on signature-specific ENS TXT records and a compact Ed25519 text format.cl.sig.pubandcl.sig.kid(with delegation viacl.receipt.signer) and support a simpleed25519:<base64>env/local key representation.Description
RECEIPT_SIGNING_PUBLIC_KEY(expectsed25519:<base64>) instead ofRECEIPT_SIGNING_PUBLIC_KEY_PEM_B64, and added strict parsing/validation for that format.parseEd25519PublicKeyTextanded25519PublicKeyObjecthelpers to validate theed25519:<base64>form and construct a usable NodePublicKey(SPKI DER) from raw 32-byte key bytes.resolveSignatureKey(name)abstraction that resolvescl.receipt.signeron the verifier name (delegation), then readscl.sig.pubandcl.sig.kidon the signer name and returns{ pubkeyBytes, kid, signer, source, cache }.cl.receipt.pubkey.pem) with the new TXT keys:cl.receipt.signer,cl.sig.pub, andcl.sig.kid, and updated/verifyand debug endpoints to use and report the new fields (including surfacedkid).verifyEd25519Base64to accept raw pubkey bytes and verify via the constructed Ed25519 public key object.RECEIPT_SIGNING_PUBLIC_KEYined25519:<base64>format and updated README and docs (docs/CONFIGURATION.md,docs/OPERATIONS.md) to reflect new env vars and ENS TXT keys.Testing
node --check server.mjswith no syntax errors. (succeeded)npm testwhich starts the server and exercises signing and verification flows; all tests passed. (succeeded)Codex Task