Skip to content

Commit e356ea7

Browse files
committed
Simplify bedrock token passing
1 parent 6d5cfad commit e356ea7

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/providers/__tests__/bedrock-reasoning.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ describe("AwsBedrockHandler - Extended Thinking", () => {
313313
expect(BedrockRuntimeClient).toHaveBeenCalledWith(
314314
expect.objectContaining({
315315
region: "us-east-1",
316-
token: "test-api-key-token",
316+
token: { token: "test-api-key-token" },
317+
authSchemePreference: ["httpBearerAuth"],
317318
}),
318319
)
319320

src/api/providers/bedrock.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
SystemContentBlock,
99
} from "@aws-sdk/client-bedrock-runtime"
1010
import { fromIni } from "@aws-sdk/credential-providers"
11-
import { fromStatic } from "@aws-sdk/token-providers"
1211
import { Anthropic } from "@anthropic-ai/sdk"
1312

1413
import {
@@ -225,7 +224,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
225224

226225
if (this.options.awsUseApiKey && this.options.awsApiKey) {
227226
// Use API key/token-based authentication if enabled and API key is set
228-
clientConfig.token = fromStatic({ token: { token: this.options.awsApiKey } })
227+
clientConfig.token = { token: this.options.awsApiKey }
229228
clientConfig.authSchemePreference = ["httpBearerAuth"] // Otherwise there's no end of credential problems.
230229
} else if (this.options.awsUseProfile && this.options.awsProfile) {
231230
// Use profile-based credentials if enabled and profile is set

src/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@
410410
"@anthropic-ai/vertex-sdk": "^0.7.0",
411411
"@aws-sdk/client-bedrock-runtime": "^3.848.0",
412412
"@aws-sdk/credential-providers": "^3.848.0",
413-
"@aws-sdk/token-providers": "^3.848.0",
414413
"@google/genai": "^1.0.0",
415414
"@lmstudio/sdk": "^1.1.1",
416415
"@mistralai/mistralai": "^1.3.6",

0 commit comments

Comments
 (0)