feat: deliver signed webhooks#122
Closed
felixvippp-ai wants to merge 7 commits into
Closed
Conversation
Contributor
|
thanks for the effort @felixvippp-ai 🙏 this issue isn't assigned to you — please claim an open unassigned issue first, then open your PR. closing for now, hope to see it back 🙌 |
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.
Closes #32
Summary
recordEvent()emits matching events.*event matching.whsec_...secret at registration and returned it only once.deadLetters.X-AgentPay-Signatureplus delivery/event headers.POST /api/v1/webhooks/:id/testto perform a real signed delivery.ALLOW_PRIVATE_WEBHOOKS=true.docs/webhooks.mddocumenting payloads, headers, signatures, retry behavior, dead letters, and SSRF controls.Validation
npm.cmd run build$env:NODE_ENV='test'; node --test dist/webhooks/deliver.test.js$env:NODE_ENV='test'; node --test dist/*.test.js dist/**/*.test.jsnpm.cmd run lintnpx.cmd prettier --check src/events.ts src/routes/webhooks.ts src/store/state.ts src/routes/operational.test.ts src/webhooks/deliver.ts src/webhooks/deliver.test.ts docs/webhooks.mdgit diff --checkFull post-clean rebuild test result:
Note: the repository
npm testscript uses POSIXNODE_ENV=testsyntax, which Windowscmd.execannot execute directly. I ran the same built test set with PowerShell's$env:NODE_ENV='test'before invokingnode --test.Security Notes
httpandhttps.ALLOW_PRIVATE_WEBHOOKS=trueis intended only for controlled local/test environments.verifyWebhookSignature()uses constant-time comparison for receiver-side checks.