Support runtime signing env aliases for Coinbase webhook receipt signing#298
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
*_PEM_B64) and convert literal\nsequences to real newlines to support common CI/runtime secret encodings.signing_unavailable.Description
normalizePemValue,resolveFirstEnv,resolveReceiptSigningConfigFromEnv,hasValidSigningConfig) and export them fromlib/receiptSigning.js.signReceiptrather than reading specific env vars directly.api/examples/coinbase-webhook.js) to use the resolved signing config and to inject the resolved signer id into normalized receipts.RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64works and update docs to listRECEIPT_SIGNING_PRIVATE_KEY_PEM_B64as a supported runtime-compatible alias; files changed:lib/receiptSigning.js,api/examples/coinbase-webhook.js,tests/api-coinbase-webhook.test.js,docs/integrations/coinbase-cdp-webhook-receipts.md.CL_RECEIPT_SIGNER_ID,RECEIPT_SIGNER_ID,CL_RECEIPT_SIGNER; kidCL_RECEIPT_SIGNING_KID,RECEIPT_SIGNING_KID,CL_RECEIPT_SIGNING_KEY_ID,CL_KEY_ID; private keyCL_RECEIPT_SIGNING_PRIVATE_KEY_PEM,RECEIPT_SIGNING_PRIVATE_KEY_PEM,CL_PRIVATE_KEY_PEM, and base64 aliasesCL_RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64,RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64,RECEIPT_SIGNING_PRIVATE_KEY_B64,CL_PRIVATE_KEY_PEM_B64.Testing
npm test, and all tests passed (63 passed, 0 failed), including the new testruntime-compatible alias RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64 signs successfully.signing_unavailablefor missing/invalid signing configuration remains covered by tests and continues to pass.Codex Task