Skip to content

feat(webhooks): sign webhook deliveries with managed rotation keys - #1472

Open
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1234-webhook-managed-rotation-keys
Open

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1234-webhook-managed-rotation-keys

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1234

Summary

Wires WebhookSigner into dispatchWebhook (src/webhooks/webhook.dispatcher.ts) and the admin key rotation routes (src/routes/admin/webhookKeys.ts) via a shared default signer instance (getDefaultWebhookSigner). Outbound webhook deliveries now include X-Callora-Signature-Kid alongside X-Callora-Signature and X-Callora-Timestamp, and WebhookSigner.verifyPayload verifies signatures during key rotation grace windows while rejecting expired retired keys.

Acceptance Criteria Mapping

  • Every outbound webhook delivery includes X-Callora-Signature, X-Callora-Timestamp, and X-Callora-Signature-Kid: Verified in src/webhooks/webhook.dispatcher.test.ts.
  • Rotating keys via the admin route changes the kid used on subsequent deliveries: Admin routes share getDefaultWebhookSigner() with dispatchWebhook.
  • verifyPayload accepts signatures from both active and grace-period keys and rejects expired retired keys: Implemented and verified in src/services/webhookSigner.test.ts.
  • Documentation matches the emitted headers: Updated WEBHOOK_SIGNATURE_VERIFICATION.md.

Validation

  • npx jest src/services/webhookSigner.test.ts src/webhooks/webhook.dispatcher.test.ts --no-cache (all 76 tests pass).

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sign webhook deliveries with managed rotation keys

1 participant