Skip to content

feat: resolve issues #125 #152 #154 #156#228

Merged
rohan911438 merged 1 commit into
rohan911438:mainfrom
JONAH-6:main
May 30, 2026
Merged

feat: resolve issues #125 #152 #154 #156#228
rohan911438 merged 1 commit into
rohan911438:mainfrom
JONAH-6:main

Conversation

@JONAH-6
Copy link
Copy Markdown
Contributor

@JONAH-6 JONAH-6 commented May 29, 2026

Summary

Resolves four issues: database performance, device-based fraud detection, external webhook integration, and admin
observability.

Changes

Database (migrations/)

  • 004_optimize_indexes.sql — composite, partial, and unique indexes for frequent query patterns
  • 005_webhooks.sqlwebhooks and webhook_deliveries tables with indexes
  • 006_admin_audit.sqladmin_audit_logs table with indexes

Backend (src/)

  • auth/deviceFingerprint.ts — SHA-256 fingerprint generator (user-agent + accept-* headers + IP)
  • auth/riskEngine.ts — fingerprint-aware device tracking; fingerprint field on AuthEvent
  • modules/webhooks/webhookService.ts — webhook CRUD, EventBus integration, SSRF validation, HMAC timestamp-signed
    delivery, 5-attempt exponential retry with jitter, dead-letter, secret rotation
  • modules/admin/adminAuditService.ts — admin action log store
  • middleware/adminAudit.tscreateAdminAuditHook(action) factory for Fastify preHandler
  • routes/webhooks.ts — webhook management endpoints including secret rotation and manual delivery retry
  • routes/auth.ts — fingerprint extraction and injection into auth events
  • routes/admin.ts — audit hooks on mutating routes; GET /admin/audit and GET /admin/audit/:id
  • container.ts — register webhooks, adminAudit, authRiskEngine, and other previously-untyped services in
    container interface and factory

Closes

Closes #125
Closes #152
Closes #154
Closes #156

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@JONAH-6 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@rohan911438 rohan911438 merged commit e6f9a8a into rohan911438:main May 30, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants