( headers: Record<string, string>, isNonInteractiveSession: boolean, )
| 359 | } |
| 360 | |
| 361 | async function configureApiKeyHeaders( |
| 362 | headers: Record<string, string>, |
| 363 | isNonInteractiveSession: boolean, |
| 364 | ): Promise<void> { |
| 365 | const activeProvider = getActiveProviderConfig() |
| 366 | const token = |
| 367 | getConfiguredProviderAuthToken() || |
| 368 | (isOpenAICompatibleProviderType(activeProvider.type) |
| 369 | ? getConfiguredProviderApiKey() |
| 370 | : undefined) || |
| 371 | process.env.ANTHROPIC_AUTH_TOKEN || |
| 372 | (await getApiKeyFromApiKeyHelper(isNonInteractiveSession)) |
| 373 | if (token) { |
| 374 | headers['Authorization'] = `Bearer ${token}` |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | function getCustomHeaders(): Record<string, string> { |
| 379 | const customHeaders: Record<string, string> = {} |
no test coverage detected