Cockatrice/tests
Lukas Brübach b2f63255f0 [Security] Add per-address rate limiting for auth endpoints
Introduce a thread-safe RateLimiter that tracks attempts per key
(IP address) within a sliding time window, and wire it into the
authentication endpoints:

- Login: failed login attempts from an address are counted; once the
  configured maximum is exceeded within the window, further logins
  from that address are rejected with RespTooManyRequests. A
  successful login clears the failed attempts for that address.
- Registration: implement the previously stubbed
  tooManyRegistrationAttempts, limiting how many accounts can be
  created per address per window.
- Forgot-password: throttle both the email-request and the
  email-challenge paths per address.

New [security] settings with defaults:
  max_login_attempts_per_ip=5 / login_attempt_window_seconds=900
  max_registrations_per_ip=2 / registration_window_seconds=3600
  max_forgot_password_requests_per_ip=3 / forgot_password_window_seconds=3600

Adds unit tests for the RateLimiter (window limit, over-limit
blocking, clearing, per-key independence).

Took 3 minutes
2026-08-04 10:38:20 +02:00
..
card_zone_algorithms [Game/Zones] Simple move refactor to differentiate between logic and graphics for zones (#6903) 2026-05-18 06:36:18 +02:00
carddatabase [Card Database] Improve loading times through binary cache (#7051) 2026-07-27 23:12:53 +02:00
loading_from_clipboard Fix/cmake test only build (#6709) 2026-03-15 17:24:50 +01:00
movecard_tests Fix #6659: Correct logging for bottom-of-library card moves (#6764) 2026-04-21 19:05:31 +02:00
oracle Fix/cmake test only build (#6709) 2026-03-15 17:24:50 +01:00
settings [Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050) 2026-07-27 11:25:39 +02:00
clamped_arithmetic_test.cpp Unify counter clamp arithmetic into shared addClamped() helper (#7009) 2026-06-28 16:10:57 -07:00
CMakeLists.txt [Security] Add per-address rate limiting for auth endpoints 2026-08-04 10:38:20 +02:00
deck_hash_performance_test.cpp Hashing tests (#5026) 2025-12-23 17:48:10 +01:00
dummy_test.cpp Clang script (#3085) 2018-02-06 08:45:13 -05:00
expression_test.cpp Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
password_hash_test.cpp Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212) 2025-10-09 07:36:12 +02:00
rate_limiter_test.cpp [Security] Add per-address rate limiting for auth endpoints 2026-08-04 10:38:20 +02:00
server_card_counter_test.cpp Split trice_limits.h into dedicated headers (#7025) 2026-06-29 14:37:52 -07:00
server_counter_test.cpp Centralize counter API with server-side bounds and no-op filtering (#6879) 2026-05-21 20:39:35 -07:00
test_age_formatting.cpp do not save a const reference to the user data in the info dialog (#6974) 2026-06-09 23:35:00 -07:00