mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
security: add per-IP sliding-window rate limit on POST /api/auth/login
5 attempts / 15 min per IP. Excess attempts get 429 + Retry-After. Client IP read from X-Forwarded-For with loopback fallback. In-memory; prune inline on each check. Refactored app() into app_with_state() + thin wrapper. Uses parking_lot::Mutex (no unwrap, no poisoning).
This commit is contained in:
parent
3b3b0d7207
commit
a8e52bdf71
3 changed files with 189 additions and 18 deletions
|
|
@ -32,3 +32,4 @@ base64 = "0.22"
|
|||
argon2 = { version = "0.5", features = ["std"] }
|
||||
rand = { version = "0.8", features = ["std"] }
|
||||
axum-extra = { version = "0.9", features = ["cookie"] }
|
||||
parking_lot = "0.12"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue