fix: preserve provider auth metadata

This commit is contained in:
elky
2026-06-20 22:11:42 +08:00
parent 1123095bb7
commit f1c30439ff
51 changed files with 2098 additions and 420 deletions
@@ -39,4 +39,14 @@ describe('providerKeyAuth', () => {
expect(shouldShowOAuthRefreshControl(input)).toBe(true)
expect(getProviderMaskedSecretLabel(input, 'codex')).toBe('[OAuth Token]')
})
it('renders OAuth-managed authorization header credentials as OAuth Header', () => {
const input = {
auth_type: 'oauth',
oauth_managed: true,
oauth_header_auth: true,
}
expect(getProviderMaskedSecretLabel(input, 'codex')).toBe('[OAuth Header]')
})
})
+2
View File
@@ -4,6 +4,7 @@ export interface ProviderKeyAuthCarrier {
credential_kind?: string | null
runtime_auth_kind?: string | null
oauth_managed?: boolean | null
oauth_header_auth?: boolean | null
oauth_temporary?: boolean | null
can_refresh_oauth?: boolean | null
can_export_oauth?: boolean | null
@@ -121,6 +122,7 @@ export function getProviderMaskedSecretLabel(
providerType?: string | null,
): string {
if (isGrokSessionCredential(input, providerType)) return '[Session Cookie]'
if (isOAuthManagedCredential(input) && input.oauth_header_auth === true) return '[OAuth Header]'
if (isOAuthManagedCredential(input)) return '[OAuth Token]'
if (isServiceAccountCredential(input)) return '[Service Account]'
if (getProviderRuntimeAuthKind(input) === 'mixed') return '[Key]'