Implement CHIS session validation

This commit is contained in:
ila
2026-07-05 11:13:34 +08:00
parent 07e6c2b9a3
commit 83c1100aa8
7 changed files with 100 additions and 10 deletions
+9
View File
@@ -115,3 +115,12 @@
- 阻塞:无。
- 决策:T-101 只迁移登录链路,不接 Redis,不做会话有效性查询;登录客户端从 `CHIS_BASE_URL`、`CHIS_PUBLIC_KEY`、`CHIS_PROXY` 创建,完成 `myRoles`、角色选择、`myApps`、JSESSIONID 提取和 cookie 组装。
- 下一步:T-102 接入账号信息查询验证会话。
## 2026-07-05 T-102 接入账号信息查询验证会话
- 状态:DONE
- 变更:`app/chis/auth.py` 新增 `ChisLoginClient.get_lander_info(cookie)`,使用已有 cookie 调用 `chis.myPageService / getLanderInfo`;`tests/test_chis_auth.py` 新增会话验证成功和会话失效测试;更新任务看板、API 合约、当前状态和根目录任务总览。
- 验证:先执行 `python -m pytest tests\test_chis_auth.py -k lander`,看到 `AttributeError: 'ChisLoginClient' object has no attribute 'get_lander_info'`;实现后执行同一命令结果 `2 passed, 6 deselected`;执行 `python -m pytest` 结果 `12 passed`。
- 阻塞:无。
- 决策:T-102 只做已有 cookie 的账号信息查询和失效判断;Redis 缓存、清理缓存和重登策略留给 T-103 / T-104。
- 下一步:T-103 实现 Redis 会话缓存。