Skip to content
Back to skills

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
developmentapifrontend

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2479-tasks_3515ad40 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2479 Tasks 3515ad40?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2479 Tasks 3515ad40
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2479-tasks-3515ad40/badge)](https://www.skillsdirectory.com/skills/tools-only-2479-tasks-3515ad40)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# 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.md986 B
  • skill.md881 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.