fix(auth): support official Command Code environment names

This commit is contained in:
Patrick Wozniak
2026-08-25 15:54:29 +02:00
parent c51a790530
commit 6a7a71e206
13 changed files with 31 additions and 14 deletions
+10 -3
View File
@@ -21,10 +21,17 @@ async function withAuthFile(
}
describe("getConfiguredApiKey()", () => {
it("prefers the environment variable", () => {
it("prefers the official environment variable and keeps the legacy alias", () => {
assert.equal(
getConfiguredApiKey({ env: { COMMANDCODE_API_KEY: "env-key" }, authPaths: [] }),
"env-key",
getConfiguredApiKey({
env: { COMMAND_CODE_API_KEY: "official-key", COMMANDCODE_API_KEY: "legacy-key" },
authPaths: [],
}),
"official-key",
)
assert.equal(
getConfiguredApiKey({ env: { COMMANDCODE_API_KEY: "legacy-key" }, authPaths: [] }),
"legacy-key",
)
})