Add Redis rate limiting, login lockout, password policy and health probes

- RateLimitFilter: fixed-window counters in Redis (Lua INCR+PEXPIRE) per
  client IP for login, registration, refresh, check-login, post creation,
  uploads, chat start and public ad endpoints; 429 with Retry-After; fails
  open when Redis is down. Rules live in rate-limit.* in application.yaml.
- Login is blocked for an account after 10 failed attempts in 15 minutes,
  independent of the client IP.
- Registration requires a password of at least 8 characters.
- server.forward-headers-strategy=native so the client IP survives a reverse
  proxy; graceful shutdown.
- /actuator/health with liveness/readiness probes is public (no details).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-20 01:31:12 +03:00
parent a696a21a1f
commit 48351398b5
11 changed files with 542 additions and 9 deletions

View File

@@ -8,5 +8,6 @@ public enum ErrorCode {
UNAUTHORIZED,
FORBIDDEN,
CONTENT_BLOCKED,
INVALID_STATUS_TRANSITION
INVALID_STATUS_TRANSITION,
TOO_MANY_REQUESTS
}