dorfteich/apps/api/src/rate-limit
Claude Fable 5 31f23c12a2 Add DB-backed rate limiting with guard and decorator
RateLimitService implements fixed-window counters as one atomic
PostgreSQL upsert (race-safe under concurrency, proven by test), with
opportunistic sweeping of expired windows and an explicit reset for
successful-login scenarios. The global RateLimitGuard applies
@RateLimit({scope, limit, windowSeconds}) per client IP and answers
429 with Retry-After; main.ts trusts the single Caddy hop so req.ip
is the real client.

Closes #11

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 00:43:54 +02:00
..
rate-limit.guard.ts Add DB-backed rate limiting with guard and decorator 2026-07-05 00:43:54 +02:00
rate-limit.module.ts Add DB-backed rate limiting with guard and decorator 2026-07-05 00:43:54 +02:00
rate-limit.service.db.test.ts Add DB-backed rate limiting with guard and decorator 2026-07-05 00:43:54 +02:00
rate-limit.service.ts Add DB-backed rate limiting with guard and decorator 2026-07-05 00:43:54 +02:00