fix: support Bedrock API key login

This commit is contained in:
Armin Ronacher
2026-07-10 19:34:11 +02:00
parent 91585d9a38
commit 3ea064ea2a
10 changed files with 72 additions and 36 deletions
@@ -181,4 +181,13 @@ describe("bedrock endpoint resolution", () => {
expect(config.region).toBe("us-gov-west-1");
});
it("uses the generic API key option as a Bedrock bearer token", async () => {
const model = getModel("amazon-bedrock", "us.anthropic.claude-opus-4-8");
const config = await captureClientConfig(model, { apiKey: "bedrock-api-key" });
expect(config.token).toEqual({ token: "bedrock-api-key" });
expect(config.authSchemePreference).toEqual(["httpBearerAuth"]);
});
});