Commit Graph

10 Commits

Author SHA1 Message Date
liuxiongfeng
ce1d2904c7 test: 为测试 stub 添加缺失的 GroupRepository 接口方法
新增 BindAccountsToGroup 和 GetAccountIDsByGroupIDs 方法的 stub 实现,
确保测试文件中的 mock 类型满足 GroupRepository 接口要求。
2026-02-02 22:06:37 +08:00
shaw
1245f07a2d feat(auth): 实现 TOTP 双因素认证功能
新增功能:
- 支持 Google Authenticator 等应用进行 TOTP 二次验证
- 用户可在个人设置中启用/禁用 2FA
- 登录时支持 TOTP 验证流程
- 管理后台可全局开关 TOTP 功能

安全增强:
- TOTP 密钥使用 AES-256-GCM 加密存储
- 添加 TOTP_ENCRYPTION_KEY 配置项,必须手动配置才能启用功能
- 防止服务重启导致加密密钥变更使用户无法登录
- 验证失败次数限制,防止暴力破解

配置说明:
- Docker 部署:在 .env 中设置 TOTP_ENCRYPTION_KEY
- 非 Docker 部署:在 config.yaml 中设置 totp.encryption_key
- 生成密钥命令:openssl rand -hex 32
2026-01-26 09:19:53 +08:00
LLLLLLiulei
9bdb45be7c feat: enhance proxy management 2026-01-14 19:45:29 +08:00
yangjianbo
297f08c683 Merge branch 'test' into dev 2026-01-10 09:39:02 +08:00
yangjianbo
675543240e perf(网关): 复用分组上下文减少热路径查询
新增 GetByIDLite 并在网关与 Gemini 选择流程复用上下文 group,避免 COUNT 触发
更新 API key 中间件注入 group 上下文,减少重复查库
补充 gateway/gemini 中间件与仓库层回归测试

测试: make test
2026-01-09 23:01:42 +08:00
IanShaw027
3820232241 fix(admin): 修复表格批量操作和搜索功能问题
1. 恢复账号管理批量操作栏缺失的功能按钮
   - 添加"本页全选"按钮支持批量选择当前页所有账号
   - 添加"清除已选"按钮快速清空已选账号列表
   - 在重构拆分组件时遗漏,现已恢复

2. 修复分组管理搜索功能仅搜索当前页的问题
   - 前端:移除本地过滤逻辑,改用后端搜索
   - 后端:添加 search 参数支持,搜索名称和描述字段
   - 支持不区分大小写的模糊匹配
   - 统一所有管理页面的搜索体验
2026-01-09 18:58:06 +08:00
Edric Li
958ffe7a8a test: fix unit tests for user_agent and proxy repo interface
- Add user_agent field to API contract test expectation
- Add ListWithFiltersAndAccountCount stub to proxyRepoStub
2026-01-08 21:44:18 +08:00
Edric Li
d8e2812d80 fix: resolve CI failures
- Fix gofmt formatting issue in user_service.go
- Remove unused sql field from userAttributeValueRepository
- Update ListWithFilters signature in test stubs to match interface
- Remove Wechat field from test user data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 19:09:06 +08:00
yangjianbo
305eaabb53 test(用户): 补齐创建用户与注册单测
覆盖管理员创建用户与注册流程的关键失败分支\n完善创建成功路径的断言
2025-12-29 15:22:50 +08:00
yangjianbo
f6de36cb04 test(删除): 添加删除单测并修复中间件测试
新增 AdminService 删除路径单元测试与规范场景更新\n同步调整 Google API Key 中间件测试桩与签名
2025-12-29 15:01:19 +08:00