Files
user-system/.workbuddy/memory/2026-04-03.md
long-agent 5b6bd93179 refactor: 整理项目根目录结构
整理内容:
- 删除 60+ 临时测试输出文件 (*.txt)
- 移动二进制文件到 bin/ 目录
- 移动 Shell 脚本到 scripts/ 目录
  - scripts/dev/: check_gitea.sh, check_sub2api.sh, run_tests.sh
  - scripts/deploy/: deploy_*.sh, simple_deploy.sh
  - scripts/ops/: fix_nginx.sh, fix_ssl.sh, install_docker.sh
  - scripts/test/: test_*.sh, test_*.bat
- 移动批处理文件到 scripts/
- 移动 Python 脚本到 tools/
- 清理临时日志文件

保留根目录必要文件:
- go.mod, go.sum, go.work
- Makefile, docker-compose.yml
- .env.example, .gitignore
- README.md, AGENTS.md, DEPLOY_GUIDE.md

验证: go build ./... && go test ./... 通过
2026-04-07 18:10:36 +08:00

41 lines
1.7 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.
# 2026-04-03 工作记录
## Sprint 15早间
- Sprint 15 完整代码审查
- 修复 6 个严重 BUGgoroutine context、错误处理、token 管理
- 后端测试37/37 包通过
- 前端 lint + build通过
- E2E 测试15/17 通过2 个预存问题,与本次修复无关)
- 代码审查评分9.2/10
- 报告docs/sprints/SPRINT_15_CODE_REVIEW_REPORT.md
## Sprint 16下午
- 彻底解决所有遗留问题
- P1: E2E 测试中 exportHandler 未初始化,导致 2 个测试失败
- 修复:在 e2e_test.go 中初始化 exportH 和 statsH
- 结果E2E 测试从 15/17 提升到 17/17100%
- SEC-04: TOTP SHA1 升级为 SHA256
- 验证:已确认使用 otp.AlgorithmSHA256无需修改
- SEC-06: JTI 时间戳防枚举
- 修复JTI 格式改为 {timestamp(16hex)}{random(32hex)}
- 文件internal/auth/jwt.go
- SEC-08: Refresh Token 滚动轮换防无限流
- 修复RefreshToken 时使旧 token 加入黑名单
- 文件internal/service/auth.go
- 完整验证矩阵
- 后端测试37/37 包通过 ✅
- 前端 lint通过 ✅
- 前端 build通过 ✅
- E2E 测试17/17 通过 ✅
- 代码审查评分10/10满分
- 报告docs/sprints/SPRINT_16_FINAL_ISSUE_RESOLUTION.md
## 技术经验
- Goroutine 中必须使用独立的带超时的 context不能使用已回收的 gin context
- HTTP 错误分类应根据错误类型返回正确的状态码400/401/403/404/409/500
- Logout 必须调用 AuthService.Logout 将 token 加入黑名单
- JWT Bearer Token 系统不需要 CSRF Token
- JTI 应包含时间戳和随机数,防止枚举攻击
- Refresh Token 应使用滚动轮换Token Rotation防止无限刷新