fix(auth-broker): preserve config.yaml discovery
This commit is contained in:
@@ -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" });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user