fix(auth-broker): preserve config.yaml discovery

This commit is contained in:
can1357
2026-07-14 18:02:48 +02:00
parent 4d1cdae7e7
commit 5c16dcb154
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -1933,6 +1933,8 @@ export class AuthStorage {
blockScope,
});
return candidates[0]?.selection ?? fallback;
}
#clearProviderSessionCredentialCache(provider: string): void {
try {
this.#store.deleteCachePrefix?.(`${SESSION_STICKY_CACHE_PREFIX}${provider}:`);
@@ -62,4 +62,14 @@ describe("auth-broker config.yml key resolution", () => {
expect(config).toEqual({ url: "https://nested.example", token: "nested-token" });
});
});
test("config.yaml nested keys resolve broker url and token", async () => {
await Bun.write(
path.join(agentDir, "config.yaml"),
["auth:", " broker:", " url: https://broker.example", " token: yaml-token", ""].join("\n"),
);
await withEnv(CLEAR_BROKER_ENV, async () => {
const config = await resolveAuthBrokerConfig({ agentDir });
expect(config).toEqual({ url: "https://broker.example", token: "yaml-token" });
});
});
});