Files
novalon-manage-system/findings.md
T
张翔 b0f91d74f5 feat: 统一JWT密钥配置并修复签名验证问题
修复前端签名生成中bodyString硬编码问题
添加start-frontend.sh脚本启动前端服务
统一manage-app和gateway的JWT密钥配置
修复Repository扫描路径问题
更新测试配置和依赖
重构表名映射为sys_user和sys_role
完善用户实体类字段映射
添加集成测试配置和测试用例
2026-04-02 12:28:49 +08:00

100 lines
3.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Findings
## JWT修复发现
### JWT密钥不一致问题
- **Date:** 2026-04-02
- **Source:** Systematic Debugging Phase 2
- **Details:**
- manage-app使用默认secret: `default-secret-key-change-in-production` (39 bytes, HS256)
- gateway使用配置secret: `U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4` (58 bytes, HS384)
- 导致Token验证失败,JwtAuthenticationFilter无法添加X-User-Id header
- **Impact:** 用户管理等功能返回401错误
### 签名验证问题
- **Date:** 2026-04-02
- **Source:** Systematic Debugging Phase 2
- **Details:**
- 前端signature.ts中bodyString被硬编码为空字符串
- 导致POST请求签名不正确
- Gateway签名验证失败
- **Impact:** 登录等POST请求失败
### Repository扫描问题
- **Date:** 2026-04-02
- **Source:** 编译错误
- **Details:**
- AuditLogRepository未被扫描到
- @EnableR2dbcRepositories缺少audit.repository包路径
- **Impact:** manage-app启动失败
### JwtKeyService初始化问题
- **Date:** 2026-04-02
- **Source:** 代码审查
- **Details:**
- JwtKeyManagementConfig使用@Bean创建新实例
-@Autowired注入的实例不一致
- 密钥未正确初始化
- **Impact:** JWT验证失败
## 命名规范现状
### Service层命名
- **Date:** 2026-04-02
- **Source:** 代码扫描
- **Details:**
- 当前Service接口无统一前缀(如SysUserService
- 当前Service实现无统一后缀(如SysUserServiceImpl
- 需要统一为:接口IXxxService,实现XxxService
- **Impact:** 代码可读性和可维护性
### Repository层命名
- **Date:** 2026-04-02
- **Source:** 代码扫描
- **Details:**
- 当前Repository接口无统一前缀(如SysUserRepository
- 当前Repository实现无统一后缀
- 需要统一为:接口IXxxRepository,实现XxxRepository
- **Impact:** 代码可读性和可维护性
## 测试结果
### 初始测试结果
- **Date:** 2026-04-02
- **Source:** test-suite/tests/e2e/check_users_page.py
- **Details:**
- 登录功能:✅ 通过
- Dashboard加载:✅ 通过
- 用户管理:❌ 失败(401错误)
- 角色管理:❌ 失败(401错误)
- 其他模块:❌ 失败(401错误)
- **Impact:** 需要修复JWT和签名问题
## 技术决策
### JWT密钥管理
- **Date:** 2026-04-02
- **Decision:** 统一使用gateway的密钥配置
- **Reason:**
- Gateway密钥更长更安全(58 bytes vs 39 bytes
- 支持更强的加密算法(HS384 vs HS256
- 便于统一管理
- **Impact:** manage-app需要更新JWT配置
### 签名实现
- **Date:** 2026-04-02
- **Decision:** 修复前端bodyString处理
- **Reason:**
- 需要正确处理POST请求体
- 确保签名验证通过
- **Impact:** 前端signature.ts需要修改
### 命名规范
- **Date:** 2026-04-02
- **Decision:** 采用IXxx接口 + Xxx实现的标准命名
- **Reason:**
- 符合C#/.NET命名惯例
- 提高代码可读性
- 便于区分接口和实现
- **Impact:** 需要重命名大量文件和类