liuguancen
a548425923
fix(security): 文件列表 userId 隔离 + CAS 退出清 SSO
研读模块 /gpt/file/list 之前没强制按 userId 过滤,理论上枚举
knowledgeBaseId 能拿到他人文件元信息(虽然 download 那一步有 userId 校验
所以下不下来,但文件名/大小/上传时间会泄露)。
- FileController.listFile 强制注入 userId = getSysUserId()
- UploadFileMapper.xml BaseSelect 加 <if userId != null> 过滤分支
CAS 退出登录之前只清了本地 JWT,没调 CAS server logout,导致:
- 后端 Redis 里的 token 还在
- CAS server 的 SSO cookie 还在 → 再点"统一身份登录"立即静默登入
- 其他接 CAS 的系统也还能继续访问
新增 POST /app/api/logout:
- 删 Redis 里 LOGIN_TOKEN_KEY:{userId}:{sessionId}
- SecurityContextHolder.clearContext()
- 返回 casLogoutUrl(${serverLogout}?service=前端 login 页)
前端 Operates.vue quit() 改 async:先调 logout 拿 casLogoutUrl,
removeToken 后 window.location.href 跳过去,让 CAS 清 SSO cookie 再回 /login。
CasProperties 加回 serverLogout 字段(之前清理时删了,本次需要)。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:34:48 +08:00
..
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-05-07 20:34:48 +08:00
2026-04-02 11:36:05 +08:00
2026-04-20 15:59:11 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-05-07 14:58:53 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00
2026-04-02 11:36:05 +08:00