This repository has been archived on 2026-10-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
NeteaseUrl/web/routers
snowy-yang 91c032a1c3 feat(routes): 迁移认证端点(login/logout/heartbeat/ann_seen)
- web/routers/auth.py
  · login:邮箱/用户名登录、超长密码短路、失败锁定、封禁/禁用分支、
    管理员转 2FA 票据;成功签发 core.session 会话 Cookie(与 Flask 同格式)
  · logout:递增 login_seq 顶号 + 删 Cookie
  · heartbeat:次数校验(401/expired 语义同 Flask)
  · ann_seen:记录已读公告版本
  · 失败锁定与 2FA 票据表复用 auth_routes 模块级状态(跨栈共享,防绕锁定)
  · PBKDF2 与库操作走 asyncio.to_thread,不阻塞事件循环

测试:tests/test_auth_routes.py 5 项,全部使用**沙箱库**(pytest tmp_path +
monkeypatch auth_system/core.db 路径),不触碰生产 data/site.db。
全套:pytest 56/56;ruff All checks passed;pyright 0 errors;奇偶校验 28/28。
2026-09-26 09:54:14 +08:00
..