Skip to content

feat(notifications): add delivery service with dedupe and redaction (PR 3 of #254)#483

Merged
utksh1 merged 3 commits into
utksh1:mainfrom
Pragati5-DEBUG:feat/254-notification-service-pr3
Jun 4, 2026
Merged

feat(notifications): add delivery service with dedupe and redaction (PR 3 of #254)#483
utksh1 merged 3 commits into
utksh1:mainfrom
Pragati5-DEBUG:feat/254-notification-service-pr3

Conversation

@Pragati5-DEBUG
Copy link
Copy Markdown
Contributor

Part 3 of 5 for #254 — notification delivery service (webhook, dedupe, redaction, history).

Description

This is PR 3 of 5 for #254 (notification channels for high/critical findings).

PR 1 added database schema and models.
PR 2 added API routes for rules and history.
This PR adds the notification delivery service that actually evaluates rules and sends alerts.

What this PR adds:

backend/secuscan/notification_service.py — delivery logic
Severity matching — only notifies when finding severity meets the rule threshold
Dedupe — skips if the same rule already successfully notified the same finding
Redaction — alert payloads redact secrets (tokens, API keys, etc.) before send
Webhook — HTTP POST to configured URLs via httpx
Email — placeholder channel (logs intent, records success; SMTP not implemented yet)
History — writes every attempt to notification_history (success/failed + error)
httpx added to backend/requirements.txt
7 unit tests in testing/backend/unit/test_notification_service.py

Planned execution order:

DB schema + models ✅ merged
API routes ✅ merged
Delivery service ← this PR
Executor hook (trigger after scan)
Settings UI
Hi @utksh1 — continuing the split from #360. Please review when you can.

Type of Change

New feature (non-breaking change which adds functionality)

Checklist

My code follows the code style of this project.

I have performed a self-review of my own code.

My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label type:testing Testing work category bonus label area:backend Backend API, database, or service work labels Jun 4, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the notification delivery service, redaction/dedupe behavior, and unit coverage. The implementation is scoped, has green CI, and is acceptable for merge after updating against current main.

@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 4, 2026
@utksh1 utksh1 merged commit 4cc0ea5 into utksh1:main Jun 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work gssoc:approved Admin validation: approved for GSSoC scoring level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants