-
-
Notifications
You must be signed in to change notification settings - Fork 293
✨ feat(ssh):新增SSH密钥认证支持,支持通过SSH方式访问Git仓库 #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.0.0
Are you sure you want to change the base?
Conversation
新增SSH密钥管理功能,包括生成、查看、测试和删除SSH密钥对。在agent_tasks.py中集成SSH私钥解密和SSH克隆逻辑,支持git@格式的SSH URL。在projects.py中为SSH URL添加文件获取支持。新增ssh_keys.py端点提供完整的SSH密钥API管理。前端Account页面新增SSH密钥管理界面,Projects页面支持选择SSH Key认证类型。新增git_ssh_service.py提供SSH密钥生成、验证和Git SSH操作功能。
|
@tusik is attempting to deploy a commit to the tsinghuaiiilove-2257's projects Team on Vercel. A member of the Team first needs to authorize it. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
使用部署密钥(Deploy key)是很常见的一种CI/CD中获取代码的方式,可以更好的进行集成 |
|
收到 |
|
修复一下冲突 |
代码审查 - SSH 相关问题汇总🔴 严重安全问题1. 禁用 SSH Host Key 验证 (git_ssh_service.py:241-242)风险: 这使系统容易受到中间人攻击 (MITM)。攻击者可以冒充 GitHub/GitLab 服务器。 建议:
|
| 位置 | 问题 |
|---|---|
| git_ssh_service.py:210 | 类型标注 Dict[str, any] 应为 Dict[str, Any] |
| git_ssh_service.py:284 | 缺少空行分隔 |
| ssh_keys.py:91 | 返回值包含 fingerprint 但 schema 未定义 |
…e/git_ssh # Conflicts: # backend/app/services/scanner.py # backend/uv.lock # frontend/src/pages/Projects.tsx
🔧 refactor(git_ssh_service):重构私钥加载逻辑,增加格式兼容性处理
|
冲突已解决 |
|
✨ feat(git):改进SSH URL检测和分支克隆逻辑 📝 docs(frontend):更新SSH公钥添加说明,移除CodeUp链接
|
你自己测试过了吗? 新引入的 Bug: git_ssh_service.py:273-276 有逻辑错误: 当 branch=None 时,repo_url 和 target_dir 不会被添加到命令,导致 git clone 失败。 正确代码应该是: |
|
有分支冲突 |
- 新增SSH配置目录设置,支持持久化存储known_hosts文件 - 实现known_hosts文件清理API端点,解决主机密钥变更导致的连接问题 - 优化SSH连接策略,使用StrictHostKeyChecking=accept-new自动接受新主机密钥 - 前端添加known_hosts清理按钮,提升SSH密钥管理体验 - 改进SSH测试逻辑,正确处理部署密钥的Anonymous响应
…e/git_ssh # Conflicts: # backend/app/api/v1/endpoints/agent_tasks.py
|
增加了clone 时的know_hosts检查 |
User description
在原来git仓库token认证的基础上增加:
PR Type
Enhancement
Description
Add comprehensive SSH key authentication support for Git repositories
Integrate SSH operations into agent tasks and project file retrieval
Implement SSH key management API endpoints and frontend UI
Add SSH connection testing and validation features
Diagram Walkthrough
File Walkthrough
2 files
Register SSH keys API routerConfigure HTTP client redirect handling8 files
New SSH key management API endpointsSSH key generation and Git operations serviceIntegrate SSH authentication into agent task executionAdd SSH URL support for project file retrievalSupport SSH authentication in repository scanningNew SSH keys API client moduleAdd SSH key management UI to Account pageUpdate project form to support SSH Key authentication