Update ADR 0041: sign-in failures are counted per email and IP #439

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

MR !546 (closes #436) changed the sign-in failure counter from lowercased email alone to email and IP together, so strangers can no longer lock a Player out. The owner accepted the trade-off: guesses at one email spread over many IPs are now limited to 5 per IP (each IP still capped by the per-IP limit of 20).

ADR 0041 (docs/adr/0041-rate-limits-are-in-memory-counters-in-the-api.md) no longer matches the code:

  • Line 8 says counters are keyed "by IP and by lowercased email"; the sign-in failure counter is now keyed by email and IP together.
  • Line 12 speaks of "the per-email limits"; the sign-in one is now signInFailuresPerEmailAndIp (RATE_LIMIT_SIGN_IN_FAILURES_PER_EMAIL_AND_IP).
  • Record the trade-off and the lockout it fixes, and the rejected alternative (email-only key).

Also refresh the stale "per-email limits" comments in deploy/compose.preview.yaml and scripts/assign-dev-rate-limits.sh, and check that no deployed environment still sets the old RATE_LIMIT_SIGN_IN_FAILURES_PER_EMAIL variable (it now falls back silently to the default).

MR !546 (closes #436) changed the sign-in failure counter from lowercased email alone to email and IP together, so strangers can no longer lock a Player out. The owner accepted the trade-off: guesses at one email spread over many IPs are now limited to 5 per IP (each IP still capped by the per-IP limit of 20). ADR 0041 (`docs/adr/0041-rate-limits-are-in-memory-counters-in-the-api.md`) no longer matches the code: - Line 8 says counters are keyed "by IP and by lowercased email"; the sign-in failure counter is now keyed by email and IP together. - Line 12 speaks of "the per-email limits"; the sign-in one is now `signInFailuresPerEmailAndIp` (`RATE_LIMIT_SIGN_IN_FAILURES_PER_EMAIL_AND_IP`). - Record the trade-off and the lockout it fixes, and the rejected alternative (email-only key). Also refresh the stale "per-email limits" comments in `deploy/compose.preview.yaml` and `scripts/assign-dev-rate-limits.sh`, and check that no deployed environment still sets the old `RATE_LIMIT_SIGN_IN_FAILURES_PER_EMAIL` variable (it now falls back silently to the default).
root commented 2026-10-16 07:00:21 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit fe9f2e3bbb8c9c7f21fad05879afbe9f7de459de

mentioned in commit fe9f2e3bbb8c9c7f21fad05879afbe9f7de459de
root commented 2026-10-16 07:00:39 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !549

mentioned in merge request !549
root commented 2026-10-16 07:03:45 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit c182f1ebb7ee782f49f26e730a4f25c8e6dd35bc

mentioned in commit c182f1ebb7ee782f49f26e730a4f25c8e6dd35bc
root commented 2026-10-16 07:07:12 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 697b60f837

mentioned in commit 697b60f837d275a0214ad3d7078ea49cfbe2d943
root commented 2026-10-16 07:07:12 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 56cc57afdc

mentioned in commit 56cc57afdcbc70c4d6fb483f203e104543e91ea7
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-16 07:19:11 +00:00
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.

Dependencies

No dependencies set.

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