fix(resend): deliver webhooks with Svix signatures - #1
Closed
xirothedev wants to merge 1 commit into
Closed
Conversation
WebhookDispatcher events for resend were dispatched but no subscription
was ever registered, so nothing was delivered.
- seed key resend.webhook_targets: [{ url, signing_secret? }]
- targets register as owner-resend subscriptions on startup
- custom header factory emits svix-id/svix-timestamp/svix-signature
(HMAC-SHA256 over {id}.{timestamp}.{body}, base64, v1,<sig>)
- omitted signing secrets auto-generate as whsec_<base64> via new
prepareSeed/generatedSecrets hook in the registry entry
- tests: live http target asserts headers + signature verification
Owner
Author
|
Superseded by vercel-labs#212 — same change submitted to upstream directly. |
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.
Summary
The resend plugin dispatched
email.sent/email.delivered/etc. to the shared WebhookDispatcher, but nothing ever registered subscriptions owned byresend, so no webhook was ever delivered. This also meant Resend's real-world Svix signing scheme had no local counterpart.resend.webhook_targets: [{ url, signing_secret? }]; targets register as owner-resendsubscriptions (idempotent by URL)svix-id,svix-timestamp,svix-signature: v1,<base64 HMAC-SHA256(secret, "{id}.{timestamp}.{body}")>whsec_<base64>) and surface via generatedSecrets (resend.webhook_signing_secret) through a newprepareSeedhookTest plan
node:httptarget receivesemail.sent+email.deliveredwith correct svix-* headers and signature verified by inline HMAC recomputation; omitted-vs-explicit secret behavior--filter='./packages/*', 20/20)