Lucas Smith
653ab3678a
feat: better ratelimiting (#2520)
Replace hono-rate-limiter with a Prisma/PostgreSQL bucketed counter
approach that works correctly across multiple instances without sticky
sessions.
- Add RateLimit model with composite PK (key, action, bucket) and atomic
upsert
- Create rate limit factory with window parsing, bucket computation, and
fail-open
- Define auth-tier and API-tier rate limit instances
- Add Hono middleware, rateLimitResponse helper, and tRPC
assertRateLimit helper
- Wire rate limit headers through AppError constructor (was declared but
never assigned)
- Apply rate limits to auth routes (email-password, passkey), tRPC
routes
(2FA email, link org account), API routes, and file upload endpoints
- Add cleanup cron job for expired rate limit rows (batched delete every
15 min)
- Remove hono-rate-limiter dependency
2026-02-20 12:23:02 +11:00
..
2025-11-12 16:38:06 +11:00
2026-02-20 12:23:02 +11:00
2025-10-06 16:17:54 +11:00
2026-01-27 16:21:09 +11:00
2026-01-27 16:21:09 +11:00
2026-01-27 16:21:09 +11:00
2025-11-12 12:41:10 +11:00
2025-11-12 16:38:06 +11:00
2025-11-12 16:38:06 +11:00
2025-10-21 10:42:44 +11:00
2025-10-14 21:56:36 +11:00
2026-01-29 14:08:07 +11:00
2026-01-29 14:08:07 +11:00
2025-11-07 14:17:52 +11:00
2025-11-07 14:17:52 +11:00
2026-01-29 14:08:07 +11:00
2026-01-29 14:08:07 +11:00
2025-11-12 16:38:06 +11:00
2025-11-07 14:17:52 +11:00
2025-10-14 21:56:36 +11:00
2025-10-14 21:56:36 +11:00
2025-08-25 08:23:12 +10:00
2025-08-25 08:23:12 +10:00
2025-10-14 21:56:36 +11:00
2025-08-25 08:23:12 +10:00
2025-10-14 21:56:36 +11:00
2025-08-25 08:23:12 +10:00
2025-11-07 14:17:52 +11:00
2025-06-10 11:49:52 +10:00
2025-10-14 21:56:36 +11:00
2025-08-25 08:23:12 +10:00
2025-10-14 21:56:36 +11:00
2025-08-25 08:23:12 +10:00
2025-12-24 11:02:02 +11:00
2025-12-24 11:02:02 +11:00
2025-10-14 21:56:36 +11:00
2025-06-18 13:30:01 +10:00
2025-11-12 16:38:06 +11:00
2025-11-12 16:38:06 +11:00
2025-12-24 11:02:02 +11:00
2025-11-12 16:38:06 +11:00
2025-08-25 08:23:12 +10:00
2025-08-25 08:23:12 +10:00
2025-10-14 21:56:36 +11:00
2025-10-14 21:56:36 +11:00
2025-10-14 21:56:36 +11:00
2025-10-14 21:56:36 +11:00