Skip to content

Commit 2d72eeb

Browse files
committed
Onboard: fix non-interactive auth-choice routing
1 parent 7f152d6 commit 2d72eeb

File tree

2 files changed

+26
-19
lines changed

2 files changed

+26
-19
lines changed

src/commands/onboard-core-auth-flags.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AuthChoice, OnboardOptions } from "./onboard-types.js";
22

3-
type OnboardCoreAuthOptionKey = keyof Pick<OnboardOptions, "litellmApiKey">;
3+
type OnboardCoreAuthOptionKey = keyof Pick<OnboardOptions, "litellmApiKey" | "azureOpenaiApiKey">;
44

55
export type OnboardCoreAuthFlag = {
66
optionKey: OnboardCoreAuthOptionKey;
@@ -11,6 +11,13 @@ export type OnboardCoreAuthFlag = {
1111
};
1212

1313
export const CORE_ONBOARD_AUTH_FLAGS: ReadonlyArray<OnboardCoreAuthFlag> = [
14+
{
15+
optionKey: "azureOpenaiApiKey",
16+
authChoice: "azure-openai-api-key",
17+
cliFlag: "--azure-openai-api-key",
18+
cliOption: "--azure-openai-api-key <key>",
19+
description: "Azure OpenAI API key",
20+
},
1421
{
1522
optionKey: "litellmApiKey",
1623
authChoice: "litellm-api-key",

src/commands/onboard-non-interactive/local/auth-choice.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,6 @@ export async function applyNonInteractiveAuthChoice(params: {
162162
return null;
163163
}
164164

165-
const pluginProviderChoice = await applyNonInteractivePluginProviderChoice({
166-
nextConfig,
167-
authChoice,
168-
opts,
169-
runtime,
170-
baseConfig,
171-
resolveApiKey: (input) =>
172-
resolveApiKey({
173-
...input,
174-
cfg: baseConfig,
175-
runtime,
176-
}),
177-
toApiKeyCredential,
178-
});
179-
if (pluginProviderChoice !== undefined) {
180-
return pluginProviderChoice;
181-
}
182-
183165
const simpleApiKeyChoice = await applySimpleNonInteractiveApiKeyChoice({
184166
authChoice,
185167
nextConfig,
@@ -485,6 +467,24 @@ export async function applyNonInteractiveAuthChoice(params: {
485467
}
486468
}
487469

470+
const pluginProviderChoice = await applyNonInteractivePluginProviderChoice({
471+
nextConfig,
472+
authChoice,
473+
opts,
474+
runtime,
475+
baseConfig,
476+
resolveApiKey: (input) =>
477+
resolveApiKey({
478+
...input,
479+
cfg: baseConfig,
480+
runtime,
481+
}),
482+
toApiKeyCredential,
483+
});
484+
if (pluginProviderChoice !== undefined) {
485+
return pluginProviderChoice;
486+
}
487+
488488
if (
489489
authChoice === "oauth" ||
490490
authChoice === "chutes" ||

0 commit comments

Comments
 (0)