Implement Redis rate limiting middleware for spam endpoints (FRE-4507)

- Add ioredis dependency to API package
- Create Redis connection utility (apps/api/src/config/redis.ts)
- Create Redis-backed spam rate limit middleware with per-minute and daily limits
- Create spam classification routes (SMS, number reputation, call analysis, feedback)
- Register middleware and routes in API server
- Add 7 passing tests for rate limit enforcement
- Update vitest config with required env vars

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-29 20:54:39 -04:00
parent 7928465a58
commit 3aead0d7bb
9 changed files with 1207 additions and 8 deletions

View File

@@ -16,7 +16,8 @@
"@shieldsai/shared-notifications": "*",
"@shieldsai/shared-utils": "*",
"fastify": "^4.25.0",
"fastify-plugin": "^4.5.0"
"fastify-plugin": "^4.5.0",
"ioredis": "^5.3.0"
},
"devDependencies": {
"@types/node": "^25.6.0",