refactor(integrations): verify resend webhooks with the shared standard webhooks check
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 58/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start by reading src/lib/webhooks/standard-webhooks.ts and the Resend verifier in src/lib/adapters/resend/index.ts; this issue is blocked until #515 and #525 are on main. Then review the existing Resend tests and move scheme-level cases to src/lib/webhooks/standard-webhooks.test.ts, keeping Resend header and documented Svix example coverage. Done when Resend delegates verification to the shared check and its unit tests, Playwright spec, lint, and typecheck pass.
由索引模型根据 Issue 内容生成。
描述
Context
Raised by the Fable review of #525 (Polar webhooks, #429), comment 4591332936.
#525 adds src/lib/webhooks/standard-webhooks.ts (verifyStandardWebhook, standardWebhookKey, standardWebhookSignature), the Standard Webhooks check Polar signs with. Resend signs the same way through Svix, only under the svix-id, svix-timestamp, and svix-signature header names. #515 (Resend webhooks, #427) carries its own copy in src/lib/adapters/resend/index.ts (signingKey, svixSignature, verifyWebhook): the same key decoding, signature, and compare-every-entry loop. Once both merge there are two copies of one signature check, which can drift.
The Resend worker asked that the move wait until #515 merges, so this is its own issue rather than part of #525.
Blocked by #515 and #525 (both must be on main).
Plan
- In
src/lib/adapters/resend/index.ts, verify withverifyStandardWebhook(request, key === null ? [] : [key], RESEND_WEBHOOK_HEADERS, now), withkeyfromstandardWebhookKey(secret). - Replace
signingKeyandsvixSignaturewithstandardWebhookKeyandstandardWebhookSignatureinresendWebhookSignatureandcreateWebhook. KeepRESEND_WEBHOOK_HEADERSas Resend's header names, typedStandardWebhookHeaders. - Delete what becomes unused. Keep
RESEND_WEBHOOK_TOLERANCE_SECONDSonly if a caller still needs it, otherwise useSTANDARD_WEBHOOK_TOLERANCE_SECONDS. - Move any scheme-level tests left in
resend/index.test.tstosrc/lib/webhooks/standard-webhooks.test.ts. Keep Resend's own: its header names and the Svix documented example.
Acceptance criteria
- Resend's
verifycallsverifyStandardWebhook; no second HMAC or compare loop remains inresend/index.ts. - Every existing Resend webhook unit test passes unchanged in outcome.
- Playwright:
e2e/webhook-setup-resend.spec.tspasses unchanged. No new e2e is needed, because behavior does not change.
Files and areas
src/lib/adapters/resend/index.ts,src/lib/adapters/resend/index.test.ts,src/lib/webhooks/standard-webhooks.test.ts.- Non-goals: changing Resend's subscriptions, mapping, tolerance, or setup.
Verification
npx vitest run src/lib/adapters/resend src/lib/webhooksnpm run lint,npm run typecheck
Branch: <issue-number>-resend-shared-verifier
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: not reported by the harness
- 主要语言
- TypeScript
- 星标
- 13
- 派生
- 2
- 平均合并
- 5 小时 20 分钟
- 30 天内合并 PR
- 287
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eddiejaoude/StackDash 的其他 Issue
-
area: integrations documentation priority: P2 size: XS
难度 2/5 1-3 小时 新手友好度 78/100
eddiejaoude/StackDash#798 ·
维护者通常 1 天内回复
-
area: ops documentation priority: P3 size: XS
难度 2/5 1-3 小时 新手友好度 82/100
eddiejaoude/StackDash#796 ·
维护者通常 1 天内回复
-
area: docs documentation impact: low priority: P3 size: XS
难度 2/5 1-3 小时 新手友好度 76/100
eddiejaoude/StackDash#790 ·
维护者通常 1 天内回复
-
area: ops bug impact: low priority: P3 size: XS
难度 2/5 1-3 小时 新手友好度 76/100
eddiejaoude/StackDash#785 ·
维护者通常 1 天内回复
-
area: connections enhancement impact: low priority: P3 size: XS
难度 2/5 1-3 小时 新手友好度 86/100
eddiejaoude/StackDash#768 ·
维护者通常 1 天内回复
查看 eddiejaoude/StackDash 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
tashfeenahmed/freellmapi#2217 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
remotion-dev/skills#37 ·
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank lines未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other drags未关闭
难度 2/5 1-3 小时 新手友好度 76/100
vercel-labs/ui#1758 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
nicobailon/pi-subagents#3425 ·
维护者通常 1 天内回复