Join our community: https://t.me/+DOylgFv1jyJlNzM0
Why this matters
backend/src/middleware/rate-limiter.middleware.ts and backend/src/middleware/stream-rate-limiter.middleware.ts both configure an express-rate-limit instance with a store and window, presumably repeating the same Redis/memory-store selection logic and key-generation boilerplate. Duplicated configuration means a fix to one (e.g. the trust-proxy IP-keying bug already tracked) has to be manually mirrored in the other.
Acceptance criteria
Files to touch
backend/src/middleware/rate-limiter.middleware.ts
backend/src/middleware/stream-rate-limiter.middleware.ts
Out of scope
- Fixing the trust-proxy IP-keying issue itself (tracked separately)
- Switching rate-limit backends
Why this matters
backend/src/middleware/rate-limiter.middleware.tsandbackend/src/middleware/stream-rate-limiter.middleware.tsboth configure anexpress-rate-limitinstance with a store and window, presumably repeating the same Redis/memory-store selection logic and key-generation boilerplate. Duplicated configuration means a fix to one (e.g. the trust-proxy IP-keying bug already tracked) has to be manually mirrored in the other.Acceptance criteria
createRateLimiter(options)factory used by both middlewaresFiles to touch
backend/src/middleware/rate-limiter.middleware.tsbackend/src/middleware/stream-rate-limiter.middleware.tsOut of scope