feat(auth): 接入 Casdoor 登录并让前端持有本服务会话
管理台可以密码登录、按角色进入,并把 Watchman 会话 token 交给浏览器。HXOPS 真实跳转仍未联调。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
21338337a1
commit
ab31d828d4
64 files changed
+4140
-339
No files matched your search
@@ -0,0 +1,6 @@
|
||||
# Critic — M02 S1(编码前)
|
||||
|
||||
- 模型:claude-opus-5-thinking-high
|
||||
- 子代理:eab6ed43-cf99-4c43-8b71-b813c4101161
|
||||
- 结论:PASS。无阻断项。
|
||||
- 开工约束:只加 `pyjwt[crypto]>=2.10,<3`;锁文件只含该库及其传递依赖;不改根 `pyproject.toml`。只允许 RS256,拒绝 `alg: none` 和 HS256 混淆。过期用确定性时间。密钥只在测试内存中生成。做完停在 S2 前。
|
||||
@@ -0,0 +1,6 @@
|
||||
# Critic — M02 S2(编码前)
|
||||
|
||||
- 模型:claude-opus-5-thinking-high
|
||||
- 子代理:03d34f4b-94e1-4072-8271-0e89c535dd0c
|
||||
- 结论:PASS。无阻断项。
|
||||
- 约束:不新增依赖,不改 `uv.lock`,运行时代码不 import `httpx`。不把 `CASDOOR_*` 放进启动必填项。登录失败 41000,未配置 503 且不建会话。测试注入替身,不读 `.env.local`,不访问网络。Cookie 为 HttpOnly,本地不强制 Secure。会话表走现有 RLS。本切片不保护平台写接口。做完停在 S3 前。
|
||||
@@ -0,0 +1,4 @@
|
||||
# Critic — M02 S3(编码前)
|
||||
|
||||
- 用户在 2026-11-17 明确要求跳过编程前 critic,并默认 PASS。
|
||||
- 未另派审查模型做编码前审计。
|
||||
@@ -0,0 +1,7 @@
|
||||
# Review — M02 模块整体
|
||||
|
||||
- 审查:claude-opus-5-thinking-high,f3455ae9-1f7a-4a5b-9d2e-a030e8e79d32。结论:FAIL。
|
||||
- 必改:HXOPS 断言在没有 `casdoor_sub` 时会回退到令牌自己的 `sub`,本地用户主键可以冒充 Casdoor 身份。
|
||||
- 修复:`casdoor_sub` 必须存在,不再回退到 `sub`。`CASDOOR_ISSUER` 未配置时入口返回 503。补了缺少 `casdoor_sub` 的拒绝测试,并去掉对未导入 `pytest` 的调用。
|
||||
- 复跑:`uv run pytest services/watchman/tests -q` → 54 passed。前端 unit 9 passed。这次没有重跑 Playwright,界面没有改。
|
||||
- 未做第二次独立复审。HXOPS 真实跳转仍未联调。未标 DONE_LOCAL。
|
||||
@@ -0,0 +1,7 @@
|
||||
# Review — M02 S1
|
||||
|
||||
- 第一次审查(claude-sonnet-5-5-high,9a4bae12-f271-4fee-9944-d8cdd8fc5740):FAIL。缺 `# GUARD:`;alg none / HS256 测试没有锁住本服务自己的算法限制。
|
||||
- 修复后复审(gemini-4-hydrogen-high,351c41be-cf86-450f-8490-4ca5cf507b42):PASS。
|
||||
- 实现(gpt-5.6-terra-medium,6d369019-b392-4f7c-914f-8e83405e8124)。
|
||||
- 主 Agent 复跑:`uv run pytest services/watchman/tests -q` → 30 passed。
|
||||
- 未开始 S2。
|
||||
@@ -0,0 +1,9 @@
|
||||
# Review — M02 S2
|
||||
|
||||
- 编码前 critic(claude-opus-5-thinking-high,03d34f4b-94e1-4072-8271-0e89c535dd0c):PASS。
|
||||
- 实现(gpt-5.6-terra-medium,a062b19b-2917-44f5-a294-5fb7c63c04b2)。
|
||||
- 审查(claude-sonnet-5-5-high,bb80f999-7799-4fe8-9a49-225c95d3d25d):PASS_WITH_WARNINGS。无必改项。
|
||||
- 主 Agent 复跑:`uv run pytest services/watchman/tests -q` → 35 passed。
|
||||
- 迁移:`uv run alembic -c alembic.ini upgrade head`(在 `services/watchman`)已由实现方执行成功。
|
||||
- 真实 Casdoor HTTP 按 critic 延后。默认登录端口固定返回 503。
|
||||
- 未开始 S3。平台写接口仍匿名。
|
||||
Reference in new issue
Block a user