-
Notifications
You must be signed in to change notification settings - Fork 4
PRD-21: Webhook / Event Notification System #14
Copy link
Copy link
Open
Labels
P1High priorityHigh priorityphase-2Go-live minimumGo-live minimumprdProduct requirement documentProduct requirement document
Description
Add HMAC-signed webhook delivery for signing, policy violation, and lifecycle events with retry logic, auto-disable, and delivery logging.
Acceptance Criteria
-
webhooksandwebhook_deliveriestables created with RLS policies -
POST /signers/:id/webhookscreates a webhook and returns the HMAC secret exactly once -
GET /signers/:id/webhookslists only the authenticated owner's webhooks (no secret in response) -
DELETE /signers/:id/webhooks/:webhookIdremoves the webhook and all delivery logs -
POST /signers/:id/webhooks/:webhookId/testdelivers a test event - Successful signing triggers
signing.completedevent - Policy violation triggers
policy.violatedevent - Signer lifecycle events trigger corresponding events
- Payload includes
X-Guardian-Signatureheader with valid HMAC-SHA256 - Failed deliveries retried 3 times with exponential backoff (1s, 5s, 25s)
- HTTP 4xx responses are not retried
- Webhooks auto-disabled after 10 consecutive failures
-
consecutive_failuresresets on successful delivery - Webhook secrets stored as SHA-256 hashes, never plaintext
- Webhook URLs validated (HTTPS in production, HTTP in dev)
Tasks
- Database migration:
webhooks+webhook_deliveriestables - Install
@nestjs/event-emitter, addEventEmitterModule -
WebhookRepository,WebhookService,WebhookController -
WebhookEventService(event emitter wrapper) -
WebhookDeliveryService(HMAC, delivery, retry logic) - Integrate event emission into
InteractiveSignServiceandSignerService - Unit + integration tests
- Dashboard UI: webhook management on signer detail page (optional)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High priorityHigh priorityphase-2Go-live minimumGo-live minimumprdProduct requirement documentProduct requirement document