mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-08-14 10:56:11 +00:00
Git Clone Authentication for Private Repositories
- Uses 'git -c http.extraHeader=Authorization: Basic <base64>' for authentication
- Token is encoded as 'base64("x-access-token:TOKEN")' following GitHub's Basic Auth format
- Token is never stored in URL, git config, or project metadata
- 'GIT_TERMINAL_PROMPT=0' prevents interactive credential prompts
- Remote URL displayed in UI always has auth info stripped for security
This commit is contained in:
parent
360379f603
commit
e2824cd6e9
5 changed files with 64 additions and 14 deletions
|
|
@ -57,6 +57,7 @@ class Projects(ApiHandler):
|
|||
if project is None:
|
||||
raise Exception("Project data is required")
|
||||
git_url = project.get("git_url", "")
|
||||
git_token = project.get("git_token", "")
|
||||
if not git_url:
|
||||
raise Exception("Git URL is required")
|
||||
|
||||
|
|
@ -72,7 +73,7 @@ class Projects(ApiHandler):
|
|||
|
||||
try:
|
||||
data = projects.BasicProjectData(**project)
|
||||
name = projects.clone_git_project(project["name"], git_url, data)
|
||||
name = projects.clone_git_project(project["name"], git_url, git_token, data)
|
||||
|
||||
# Success notification
|
||||
NotificationManager.send_notification(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue