Skip to content

feat(webhooks): support multiple webhook endpoints per developer - #1471

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1241-multiple-webhooks-per-developer
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feat/1241-multiple-webhooks-per-developer

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1241

Summary

Refactors InMemoryWebhookStore (src/webhooks/webhook.store.ts) and the webhook management routes (src/routes/webhooks.ts) to assign a unique id to each registration, store multiple webhook configurations per developer (up to MAX_WEBHOOKS_PER_DEVELOPER = 10), reject duplicate URLs per developer with 409 Conflict, list all registered endpoints with secrets redacted, and support DELETE /api/webhooks/:id with ownership enforcement (404 unknown, 403 another developer's webhook).

Acceptance Criteria Mapping

  • Registering two distinct URLs for the same developer keeps both active: Stored in a per-developer list and returned by findAllByDeveloperId / GET /api/webhooks.
  • Registering a duplicate URL for the same developer returns 409; registering the eleventh returns 400: Enforced in POST /api/webhooks.
  • DELETE /api/webhooks/:id removes only the targeted registration and returns 404/403 appropriately: Enforced via findById and deleteById.
  • Secrets are never returned by GET /api/webhooks: Redacted via redactWebhook in GET /api/webhooks.

Validation

  • npx jest src/webhooks/webhook.store.test.ts src/routes/webhooks.test.ts --no-cache (all 30 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.

Support multiple webhook endpoints per developer

2 participants