feat: Webhook Event System (closes #77)#771
Open
shaidshark wants to merge 3 commits intorohitdash08:mainfrom
Open
feat: Webhook Event System (closes #77)#771shaidshark wants to merge 3 commits intorohitdash08:mainfrom
shaidshark wants to merge 3 commits intorohitdash08:mainfrom
Conversation
added 3 commits
April 3, 2026 22:22
…itdash08#77) - WebhookEndpoint model: register URLs per user with HMAC-SHA256 secrets - WebhookDelivery model: track delivery attempts, status codes, retry scheduling - 8 event types: expense/bill CRUD, budget alerts, user registration - Exponential backoff retry: 10s, 1m, 5m, 30m, 2h (max 5 attempts) - REST API: CRUD endpoints + test endpoint + delivery history - HMAC-signed payloads with timestamp for verification - Full test suite: unit + API tests - DB schema migration included
- Fix retry logic: attempts <= MAX_RETRIES so 5th retry (2h) executes - Add URL length validation (max 2048 chars) in endpoint creation - Move timedelta and secrets imports to module top level - Consistent retry condition in process_retries
- Block private IPs, localhost, link-local, cloud metadata (169.254.169.254) - DNS resolution check via socket.getaddrinfo - Description length validation (max 255 chars) - Reduce URL exposure in logs (don't log full URL at INFO)
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.
Webhook Event System - Bounty
Implements signed webhook delivery with retry handling (closes #77).
Acceptance Criteria
What's Included
Core Service (packages/backend/app/services/webhooks/):
REST API (/webhooks/*):
8 Event Types:
expense.created, expense.updated, expense.deleted, bill.created, bill.updated, bill.paid, budget.alert, user.registered
Tests: Full coverage - signature verification, event emission, retry on failure, API CRUD.
DB Schema: webhook_endpoints + webhook_deliveries tables with retry index.