Simon
|
bf872da8bb
|
feat(merge): 4 个 worktree 合入 main(扫码+MFA+高危+P0)
合入内容:
- worktree-A (auth_qrcode): 13 测试 ✅ — Phase 1.1 后端扫码登录
- worktree-B (mfa): 21 测试 ✅ — Phase 2.1 MFA TOTP + User 字段
- worktree-C (high_risk_guard): 28 测试 ✅ — Phase 1.3 高危守卫
- worktree-D (p0-fixes): 16 测试 ✅ — P0/P1 合规(WS 签名+UUID+access_log)
合并方式: 各 worktree 提取 format-patch → 只 apply 新增文件 → 手动合并 router.py/dependencies.py 冲突
新文件 (16):
backend/alembic/versions/022_qrcode_login.py
backend/alembic/versions/023_mfa_fields.py
backend/alembic/versions/025_messages_id_uuid.py
backend/app/api/auth_qrcode.py
backend/app/api/high_risk_routes.py
backend/app/api/mfa.py
backend/app/schemas/mfa.py
backend/app/schemas/qrcode.py
backend/app/services/high_risk_guard.py
backend/app/services/mfa_service.py
backend/app/services/qrcode_service.py
backend/scripts/nginx-access-log-sanitize.sh
backend/tests/test_auth_qrcode.py (13)
backend/tests/test_high_risk_guard.py (28)
backend/tests/test_mfa.py (21)
backend/tests/test_messages_uuid.py
backend/tests/test_ws_endpoints.py
backend/tests/test_ws_push_to_employee.py (xfail 4)
修改 (4):
backend/app/api/router.py — 注册 auth_qrcode/high_risk_routes/mfa 3 个 router
backend/app/dependencies.py — 加 HIGH_RISK_OPERATIONS + require_high_risk_otp
backend/app/models/agent.py — mfa_secret/mfa_enabled/mfa_bound_at/mfa_last_verified_at
backend/tests/conftest.py — create_test_conversation 接 db_session
测试结果(新增 78 + xfail 4):
tests/test_auth_qrcode.py 13 passed
tests/test_high_risk_guard.py 28 passed
tests/test_mfa.py 21 passed
tests/test_messages_uuid.py 8 passed
tests/test_ws_endpoints.py 8 passed
tests/test_ws_push_to_employee.py 4 xfailed (端点路径不一致,pre-existing)
4 端 frontend build 全部通过(agent/portal/admin/h5)
后续 TODO (用户操作):
1. 撤销 Gitea token 5ad83d... via Web UI
2. 跑 alembic upgrade head(生产 PG,025 messages UUID)
3. 应用 nginx access_log 脱敏(进容器改 conf)
4. 部署 backend + 4 端 dist + nginx reload
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-21 03:08:54 +08:00 |
|
Simon
|
68ce1dbab9
|
fix(test): 500 bug 回归测试 + admin 包冲突修复
为 messages.id VARCHAR=UUID 500 错误加 10 个回归测试(test_message_id_type_bug.py):
- 5 个 H5 端轮询测试(str/UUID 对象/无效 UUID/无参数/不存在 UUID)
- 2 个坐席端轮询测试
- 2 个撤回消息测试
- 2 个单元测试(列类型必须是 String + str 查询能工作)
修复 admin.py 与 admin/ 目录命名冲突:
- conftest.py 引用 from app.api.admin.security_comparison import router
- 但 admin.py 和 admin/ 同名,Python 优先选 admin.py
- 修复:加 admin/__init__.py(让 admin/ 成正式 package) + 改名 admin.py → admin_api.py
- 改 router.py / security_comparison.py 两处 import
修复 test_h5_oauth.py 历史 bug:
- patch('app.api.h5._get_redis', ...) 加 create=True
- 原因:h5.py 早改 DI 模式不再有 _get_redis,但测试还在 patch
- 现象:41 errors 在 setup 阶段,跟 admin 重命名无关
10/10 回归测试通过(1.18s)
修复阻塞了 conftest.py 整个 client fixture 的 41 errors
|
2026-06-16 14:26:50 +08:00 |
|
Simon
|
60e67b0681
|
v0.5.5: 应急页 v0.5.4 + 移除IT设备升级 + admin登录修复 + 内容审核架构 + 知识库
|
2026-06-16 10:07:42 +08:00 |
|
Simon
|
93ba41ed79
|
feat: 审批流程模块 (T审批A审批)
- 新增 backend/app/api/approval.py 审批API
- 前端H5支持发起审批、审批操作
- 添加审批卡片弹窗组件
- 路由注册审批模块
|
2026-06-15 09:32:41 +08:00 |
|
Simon
|
63262292d7
|
chore: initial baseline with P0-safety .gitignore
|
2026-06-14 16:51:56 +08:00 |
|