mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
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:
1 parent
5b85abd627
commit
55af93062a
31 files changed
+1136
-132
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface Repo {
|
||||
lastPulled?: number
|
||||
lastAccessedAt?: number
|
||||
openCodeConfigName?: string
|
||||
gitCredentialId?: string
|
||||
isWorktree?: boolean
|
||||
isLocal?: boolean
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user