refactor: extract CredentialProvider service and consolidate git-auth utilities (#283)

* refactor: extract CredentialProvider service and consolidate git-auth utilities

* refactor: add git-credentials route and gh env plugin, pass internal token to OpenCode

* refactor: update credential provider integration and git route

* refactor: integrate credential provider across git auth, routes, and IPC
This commit is contained in:
Chris Scott authored and GitHub committed 2026-06-20 21:52:18 -04:00
1 parent 5b85abd627
commit 55af93062a
31 files changed
+1136 -132

No files matched your search

+8
View File
@@ -114,6 +114,14 @@ export async function switchRepoConfig(id: number, configName: string): Promise<
})
}
export async function updateRepoGitCredential(id: number, credentialId?: string): Promise<Repo> {
return fetchWrapper(`${API_BASE_URL}/api/repos/${id}/git-credential`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ credentialId }),
})
}
export class GitAuthError extends Error {
code: string
constructor(message: string, code: string) {
+1
View File
@@ -12,6 +12,7 @@ export interface Repo {
lastPulled?: number
lastAccessedAt?: number
openCodeConfigName?: string
gitCredentialId?: string
isWorktree?: boolean
isLocal?: boolean
}
+2
View File
@@ -30,6 +30,7 @@ export interface CustomCommand {
}
export interface GitCredential {
id?: string
name: string
host: string
type: 'pat' | 'ssh'
@@ -61,6 +62,7 @@ export interface UserPreferences {
keyboardShortcuts: Record<string, string>
customCommands: CustomCommand[]
gitCredentials?: GitCredential[]
defaultGitCredentialId?: string
gitIdentity?: GitIdentity
tts?: TTSConfig
stt?: STTConfig