feat: 平台认证(scrypt上移/内存token 8h/登录限流/改密/角色依赖/409语义)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-13 08:18:15 +08:00
parent bfcaba5c87
commit f49e8e92b1
8 changed files with 626 additions and 71 deletions
+11
View File
@@ -75,6 +75,17 @@ def _reset_conn_limiter():
_reset_for_test()
@pytest.fixture(autouse=True)
def _reset_platform_auth():
"""Phase 2 Task 2: 平台认证模块级单例(内存 token 表/登录限流失败
计数)前后复位,跨测试不泄漏——token/限流窗不隔离会串测试(前一脚的
锁定状态顶掉后一脚的登录);注入的 TTL/窗长一并还原默认。"""
from app.platform.auth import _reset_for_test
_reset_for_test()
yield
_reset_for_test()
@pytest.fixture
def jiancai_runtime():
"""直连测试用的 jiancai TenantRuntime(Task 6: manager 的 runtime 必填)。