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 committed 2026-06-20 23:20:39 -04:00
1 parent ba08f5c24a
commit 7c8a4fe64c
31 files changed
+1136 -132

No files matched your search

+1
View File
@@ -15,6 +15,7 @@ export const RepoSchema = z.object({
lastPulled: z.number().optional(),
lastAccessedAt: z.number().optional(),
openCodeConfigName: z.string().optional(),
gitCredentialId: z.string().optional(),
isWorktree: z.boolean().optional(),
isLocal: z.boolean().optional(),
})
+3
View File
@@ -83,6 +83,7 @@ export const DEFAULT_KEYBOARD_SHORTCUTS: Record<string, string> = {
};
export const GitCredentialSchema = z.object({
id: z.string().optional(),
name: z.string(),
host: z.string(),
type: z.enum(['pat', 'ssh']).default('pat'),
@@ -146,6 +147,7 @@ export const UserPreferencesSchema = z.object({
keyboardShortcuts: z.record(z.string(), z.string()),
customCommands: z.array(CustomCommandSchema),
gitCredentials: z.array(GitCredentialSchema).optional(),
defaultGitCredentialId: z.string().optional(),
gitIdentity: GitIdentitySchema.optional(),
tts: TTSConfigSchema.optional(),
stt: STTConfigSchema.optional(),
@@ -197,6 +199,7 @@ export const DEFAULT_USER_PREFERENCES = {
customCommands: [],
customAgents: [],
gitCredentials: [] as GitCredential[],
defaultGitCredentialId: undefined as string | undefined,
gitIdentity: DEFAULT_GIT_IDENTITY,
tts: DEFAULT_TTS_CONFIG,
stt: DEFAULT_STT_CONFIG,