Rate limits on sign-up, sign-in and reset requests, with when to try again #381

Closed
opened 2026-10-11 16:27:01 +00:00 by root · 17 comments
root commented 2026-10-11 16:27:01 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#381, opened by @amaurycoudr on 2026-10-11 16:27 UTC.


Parent

#364

What to build

Sign-up, sign-in and reset requests are rate-limited by in-memory sliding-window counters in the API, on an injected clock. Failed sign-ins are limited per email (5 per 15 minutes) and per IP (20 per 15 minutes). Reset requests are limited per email (3 per hour) and per IP (10 per hour). Sign-ups are limited per IP (10 per hour). Emails are counted lowercased, whether or not they have an Account. The IP is the client's as one trusted proxy hop forwards it. A refused call is TOO_MANY_REQUESTS (429), carrying the seconds to wait in a Retry-After header and in its error data. The sign-up, sign-in and forgot-password forms tell the Player when they can try again. Each limit is a config default that an environment variable may override. Dev, CI and previews raise the per-IP limits so the browser suite can sign up from one address; the per-email limits keep production values everywhere. This ticket writes the rate-limit ADR.

Seam: loadConfig; the RPC wire (with the fake clock); the front views

Acceptance criteria

  • Each of the five limits is tested one under and at its boundary, with its retry-after, and its window rolling on the fake clock
  • A limited email reveals nothing: an email with no Account is counted the same way
  • TOO_MANY_REQUESTS joins the refusal status table as 429 and the errors of signUp, signIn and requestPasswordReset
  • loadConfig parses the rate-limit overrides, tested beside the existing config tests; dev, CI and previews raise the per-IP limits
  • The sign-up, sign-in and forgot-password views show the rate-limit message with the wait, in English and French
  • The rate-limit ADR and its index row land
  • The ADR is this ticket's first commit, before any code it governs
> _Imported from GitHub [amaurycoudr/chess-project#381](https://github.com/amaurycoudr/chess-project/issues/381), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 16:27 UTC._ <!-- github-issue:381 --> --- ## Parent #364 ## What to build Sign-up, sign-in and reset requests are rate-limited by in-memory sliding-window counters in the API, on an injected clock. Failed sign-ins are limited per email (5 per 15 minutes) and per IP (20 per 15 minutes). Reset requests are limited per email (3 per hour) and per IP (10 per hour). Sign-ups are limited per IP (10 per hour). Emails are counted lowercased, whether or not they have an **Account**. The IP is the client's as one trusted proxy hop forwards it. A refused call is `TOO_MANY_REQUESTS` (429), carrying the seconds to wait in a `Retry-After` header and in its error data. The sign-up, sign-in and forgot-password forms tell the **Player** when they can try again. Each limit is a config default that an environment variable may override. Dev, CI and previews raise the per-IP limits so the browser suite can sign up from one address; the per-email limits keep production values everywhere. This ticket writes the rate-limit ADR. Seam: `loadConfig`; the RPC wire (with the fake clock); the front views ## Acceptance criteria - [ ] Each of the five limits is tested one under and at its boundary, with its retry-after, and its window rolling on the fake clock - [ ] A limited email reveals nothing: an email with no **Account** is counted the same way - [ ] `TOO_MANY_REQUESTS` joins the refusal status table as 429 and the errors of `signUp`, `signIn` and `requestPasswordReset` - [ ] `loadConfig` parses the rate-limit overrides, tested beside the existing config tests; dev, CI and previews raise the per-IP limits - [ ] The sign-up, sign-in and forgot-password views show the rate-limit message with the wait, in English and French - [ ] The rate-limit ADR and its index row land - [ ] The ADR is this ticket's first commit, before any code it governs
root commented 2026-10-11 16:27:01 +00:00 (Migrated from gitlab.core-project.space)

GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links).

  • Parent (sub-issue of): #364
  • Blocked by: #380
  • Blocking: #385
> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Parent (sub-issue of): #364 - Blocked by: #380 - Blocking: #385
root commented 2026-10-13 08:39:50 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #385

mentioned in issue #385
root commented 2026-10-13 08:41:22 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #364

mentioned in issue #364
root commented 2026-10-13 08:41:27 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #380

mentioned in issue #380
root commented 2026-10-13 08:42:29 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #364

marked this issue as related to #364
root commented 2026-10-13 08:42:39 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #380

marked this issue as related to #380
root commented 2026-10-13 08:42:39 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #385

marked this issue as related to #385
root commented 2026-10-14 10:36:16 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !523

mentioned in merge request !523
root commented 2026-10-14 11:43:07 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 26e6d97940eaab86b68fd4f88c5d19879e68ead6

mentioned in commit 26e6d97940eaab86b68fd4f88c5d19879e68ead6
root commented 2026-10-14 11:43:07 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 2d3fa7596ab48eb201709625378622803353f5c6

mentioned in commit 2d3fa7596ab48eb201709625378622803353f5c6
root commented 2026-10-14 11:43:07 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 08aef0bbbed6cf66b8ed2edd0eee9a3b625deb03

mentioned in commit 08aef0bbbed6cf66b8ed2edd0eee9a3b625deb03
root commented 2026-10-14 12:19:57 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 06ade4f96f

mentioned in commit 06ade4f96fda73e20722732e46e8734575f4e2b5
root commented 2026-10-14 12:19:57 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 264bc50a0a

mentioned in commit 264bc50a0a571dcb6c0d15b9fbd6ec82111bc08e
root commented 2026-10-14 12:19:57 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 447c6e61b2

mentioned in commit 447c6e61b2a869408d673b0abe5937a5db0b83f1
root commented 2026-10-14 13:29:00 +00:00 (Migrated from gitlab.core-project.space)

Delivered by !523, merged into main.

Delivered by !523, merged into main.
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-14 13:29:01 +00:00
root commented 2026-10-15 21:18:56 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 215cdba4c9

mentioned in commit 215cdba4c9194e91817007777bbb204e7197fb99
root commented 2026-10-15 21:19:13 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !537

mentioned in merge request !537
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
amaurycoudr/chess-project#381
No description provided.