feat(git): add token authentication and credential discovery

Add support for token-based git authentication in identity profiles.
Enable discovery and import of credentials from ~/.git-credentials file.
Introduce remote URL-based filtering for token identities in git view.
This commit is contained in:
btriapitsyn
2026-01-14 02:47:26 +02:00
parent d56eef8aa6
commit fa83c1e645
16 changed files with 704 additions and 44 deletions
+12
View File
@@ -168,16 +168,25 @@ export interface GitPullResult {
deletions: number;
}
export type GitIdentityAuthType = 'ssh' | 'token';
export interface GitIdentityProfile {
id: string;
name: string;
userName: string;
userEmail: string;
authType?: GitIdentityAuthType;
sshKey?: string | null;
host?: string | null;
color?: string | null;
icon?: string | null;
}
export interface DiscoveredGitCredential {
host: string;
username: string;
}
export interface GitIdentitySummary {
userName: string | null;
userEmail: string | null;
@@ -290,6 +299,9 @@ export interface GitAPI {
createGitIdentity(profile: GitIdentityProfile): Promise<GitIdentityProfile>;
updateGitIdentity(id: string, updates: GitIdentityProfile): Promise<GitIdentityProfile>;
deleteGitIdentity(id: string): Promise<void>;
discoverGitCredentials?(): Promise<DiscoveredGitCredential[]>;
getGlobalGitIdentity?(): Promise<GitIdentitySummary | null>;
getRemoteUrl?(directory: string, remote?: string): Promise<string | null>;
}
export interface FileListEntry {