fix(notification-routing): harden with security fixes, validation, and test coverage (#573)

- Add authMiddleware to GET/POST /api/agents (previously unauthenticated)
- Add input validation to POST /api/agents (type, URL, enabled)
- Add URL host validation via new URL() to notification-routes POST/PUT
- Add priority type validation and enabled boolean check to routes
- Add name length limit (100 chars) to routes POST/PUT
- Add stack pattern dedup and whitespace filtering
- Add NaN guard to DELETE /api/notifications/:id
- Add dispatch_error to NotificationHistory TypeScript interface
- Extract cleanStackPatterns() and validateHttpsUrl() helpers
- Add standard and diagnostic logging to agents and routes endpoints
- Add comprehensive integration tests for notification-routes CRUD
- Add agents auth and validation tests
- Add dispatch error recording unit tests
This commit is contained in:
Anso
2026-04-13 22:17:03 -04:00
committed by GitHub
parent 96a653e54f
commit e59df354e2
5 changed files with 559 additions and 27 deletions
+1
View File
@@ -109,6 +109,7 @@ export interface NotificationHistory {
message: string;
timestamp: number;
is_read: boolean;
dispatch_error?: string;
}
export interface FleetSnapshot {