Skip to content

feat(auth): rate limit login and register by IP and e-mail - #23

Merged
pitercoding merged 1 commit into
mainfrom
feat/login-rate-limit
Nov 24, 2026
Merged

pitercoding merged 1 commit into
mainfrom
feat/login-rate-limit

Conversation

@pitercoding

Copy link
Copy Markdown
Owner

Adds rate limiting to the public auth endpoints (not wired into main yet):

  • platform.Limiter: sliding window log, injectable clock, in-memory with
    periodic sweep of idle keys, safe for concurrent use
  • platform.ClientIP: reads X-Forwarded-For only from a configured number
    of trusted proxies, so the header cannot be forged to dodge limits
  • login and register limited per IP and per e-mail (hashed key), answering
    429 with Retry-After; limits are on by default

Covered by unit tests with a fake clock and endpoint tests.

@pitercoding
pitercoding merged commit 6a4ee2a into main Nov 24, 2026
4 checks passed
@pitercoding
pitercoding deleted the feat/login-rate-limit branch November 24, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant