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.
Motivation
CL_*env names and legacy aliases for signer identity and keys and produce properly-signed receipts./healthand/describemust reflect signer status and includekid/canonical_idand full proof fields when signing succeeds.Description
SIGNER_IDis read fromCL_RECEIPT_SIGNERorRECEIPT_SIGNER_ID,SIGNER_KIDfromCL_KEY_IDorSIGNER_KID, andCANONICAL_IDfromCL_CANONICAL_IDwith fallback toCANONICAL_ID_SORTED_KEYS_V1when missing, and added support forRECEIPT_SIGNING_*key aliases andRECEIPT_SIGNING_PUBLIC_KEY_PEM_B64.normalizePemLoose,getPrivatePem,validatePrivateKeyPem,getPublicPemFromEnv,validatePublicKeyPem) to accept escaped single-line PEM, base64-encoded PEM, raw 32-byte public key (CL_PUBLIC_KEY_B64) -> SPKI PEM, and to validate keys withcryptowithout throwing on boot.signerBootState) that collects validation errors andmaybeEnableDevAutoKeys()still provides dev keys when enabled, and the server no longer crashes on invalid signer config.makeReceipt()always invokessignReceiptEd25519Sha256(...)with normalized fields includingsigner_id,kid,canonical_id, andprivateKeyPemwhen a valid private key is present sometadata.proof.hash_sha256andmetadata.proof.signature_b64are populated.respondSigningError()(includingmetadata.proofwith null hash/signature) instead of crashing, and preserved/verifyusage ofverifyReceiptEd25519Sha256withallowedCanonicals: [CANONICAL_ID]and existing ENS checks.kid,canonical_id, andsigner_errorsto/healthand madesigner_okreflect validated signer readiness rather than raw env presence.Testing
node --check server.mjswhich succeeded.PORT=18080 node server.mjsand confirmed/healthreturnssigner_ok: falsewithkidandcanonical_idpresent andsigner_errorspopulated.CL_RECEIPT_SIGNER,CL_KEY_ID,CL_CANONICAL_ID,CL_PRIVATE_KEY_PEMandCL_PUBLIC_KEY_B64, startedPORT=18082 node server.mjs, and confirmed/healthshowedsigner_ok: trueand aPOST /describe/v1.0.0returnedmetadata.proof.hash_sha256andmetadata.proof.signature_b64populated.Codex Task