feat: support private repo cloning with HTTP basic auth
Deploy PR-Helper / deploy (push) Successful in 30s

- Add SSH URL detection with friendly prompt to use HTTPS instead
- Add private repo toggle (default off) with username/password fields
- Persist auth_type and credential in repositories table
- Pass stored credentials to PullRepo for authenticated pulls
- Incremental migration adds auth_type and credential columns
This commit is contained in:
2026-06-21 14:58:12 +08:00
parent 82666cff26
commit a6bd46db34
5 changed files with 108 additions and 21 deletions
+8 -6
View File
@@ -3,10 +3,12 @@ package models
import "time"
type Repository struct {
ID int64 `json:"id"`
URL string `json:"url"`
LocalPath string `json:"local_path"`
SizeBytes int64 `json:"size_bytes"`
ClonedAt time.Time `json:"cloned_at"`
LastUsed time.Time `json:"last_used"`
ID int64 `json:"id"`
URL string `json:"url"`
LocalPath string `json:"local_path"`
SizeBytes int64 `json:"size_bytes"`
ClonedAt time.Time `json:"cloned_at"`
LastUsed time.Time `json:"last_used"`
AuthType string `json:"auth_type"`
Credential string `json:"-"` // never expose in JSON responses
}