Back to skills
SKILL.md
2479 Tasks 3515ad40
ASecurity- [x] 1. 确认 api.py 无外部依赖 - 搜索所有对 `portfolio/api.py` 的引用 ✅ 无后端依赖 - 检查是否有测试文件依赖 ✅ 无 - 前端引用的是 `frontend/src/api/portfolio.ts`,不是后端文件 - [x] 2. 删除废弃的 api.py 文件 - 删除 `/modules/portfolio/api.py` ✅ - 验证服务正常启动 ✅ 模块导入正常 - [x] 3. 验证用户隔离功能 - pytest 未安装,跳过自动化测试 - 代码审查确认 `router.py` 的所有接口都使用 `Depends(get_current_user)`
- 9 stars
- 0 votes
- 0 copies
- 0 views
- Added May 31, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add tools-only/X-Skills --skill 2479-tasks_3515ad40 --agent claude-codeAre you the author of 2479 Tasks 3515ad40?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tools-only-2479-tasks-3515ad40)# Tasks
## 方案 A:清理废弃代码
- [x] 1. 确认 api.py 无外部依赖
- 搜索所有对 `portfolio/api.py` 的引用 ✅ 无后端依赖
- 检查是否有测试文件依赖 ✅ 无
- 前端引用的是 `frontend/src/api/portfolio.ts`,不是后端文件
- [x] 2. 删除废弃的 api.py 文件
- 删除 `/modules/portfolio/api.py` ✅
- 验证服务正常启动 ✅ 模块导入正常
- [x] 3. 验证用户隔离功能
- pytest 未安装,跳过自动化测试
- 代码审查确认 `router.py` 的所有接口都使用 `Depends(get_current_user)`
## 增强安全性
- [x] 4. 移除 service.py 中的向后兼容逻辑
- 删除检查 user_id 列是否存在的代码
- 强制使用 `WHERE user_id = %(user_id)s` 过滤
- [x] 5. 修复 _batch_update_positions 缺少 user_id
- 添加 user_id 参数
- INSERT 语句中包含 user_id 字段
Files in this skill
- README.md
- skill.md
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.