What
This feature will implement a webhook notification system that allows users to subscribe to events and receive HTTP callbacks. Currently there is no way for external systems to react to events in real time.
Why
Users need to integrate with external services (Slack, PagerDuty, custom dashboards) but currently must poll the API for changes. We need a push-based notification system.
Currently event status can only be checked manually:
- Polling the
/events endpoint repeatedly
- Checking application logs for state changes
How
Add a webhook notification system with the following components:
- Add
POST /webhooks endpoint for registering webhook subscriptions with a target URL and event filter
- Implement HMAC-SHA256 payload signing using a configurable
WEBHOOK_SECRET so receivers can verify authenticity
- Add exponential backoff retry logic (max 5 attempts) for failed deliveries
- Support event types:
user.created, user.updated, order.completed
- Add a CLI command
app webhooks list to show active webhook subscriptions
- Add unit tests covering:
- Payload signing verification
- Retry logic with backoff timing
- Endpoint validation and error handling
Delivery should be async and not block the main request. Failed deliveries after all retries should be logged but not raise alerts.
Alternatives
- We could use a message queue (RabbitMQ, Kafka) instead of direct HTTP callbacks, but that adds infrastructure complexity for consumers.
- We could use WebSockets for real-time events, but not all integrations support persistent connections.
Accept
| Reviewer | Date | Accept or Reject |
| | |
This PR implements the webhook notification system from
PROJ-456. Changes include:POST /webhooksendpoint for webhook registration with URL validationWEBHOOK_SECRET