M4-T02: add exponential login back-off service and wire into login endpoint

This commit is contained in:
2026-06-21 21:20:28 +02:00
parent 64d3882c16
commit e480a84a44
9 changed files with 654 additions and 3 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ Phase BTOTP,可选配)
- **Reviewer checklist**: `(scope,key)` 唯一;链上单 head;env.py 注册模型。
### M4-T02 — 退避 service + 接入登录
- **Status**: `todo` · **Depends**: M4-T01
- **Status**: `done` · **Depends**: M4-T01
- **Context**: 指数退避核心 + 接 `POST /api/auth/login`
- **Files**: `create app/services/login_throttle.py``modify app/api/routes/api/session.py``app/services/config_page.py`(+`CONFIG_FIELDS` `AUTH_LOGIN_THROTTLE_ENABLED`)、`app/config.py`(+`auth_login_throttle_enabled``auth_trust_forwarded_for`)`modify tests/test_api_session.py``create tests/test_login_throttle.py`
- **Steps**: