Skip to content

Commit d8fd5ce

Browse files
committed
fix(client-sts): add sts fix to template
1 parent 89403aa commit d8fd5ce

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

clients/client-sts/defaultRoleAssumers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Please do not touch this file. It's generated from template:
2+
// https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.ts
13
import {
24
DefaultCredentialProvider,
35
getDefaultRoleAssumer as StsGetDefaultRoleAssumer,

clients/client-sts/defaultStsRoleAssumers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Please do not touch this file. It's generated from template:
2+
// https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
13
import { Credentials, Provider } from "@aws-sdk/types";
24

35
import { AssumeRoleCommand, AssumeRoleCommandInput } from "./commands/AssumeRoleCommand";
@@ -39,12 +41,15 @@ export const getDefaultRoleAssumer = (
3941
stsClientCtor: new (options: STSClientConfig) => STSClient
4042
): RoleAssumer => {
4143
let stsClient: STSClient;
44+
let closureSourceCreds: Credentials;
4245
return async (sourceCreds, params) => {
46+
closureSourceCreds = sourceCreds;
4347
if (!stsClient) {
4448
const { logger, region } = stsOptions;
4549
stsClient = new stsClientCtor({
4650
logger,
47-
credentials: sourceCreds,
51+
// A hack to make sts client uses the credential in current closure.
52+
credentialDefaultProvider: () => async () => closureSourceCreds,
4853
region: decorateDefaultRegion(region),
4954
});
5055
}

codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Please do not touch this file. It's generated from template:
2+
// https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultRoleAssumers.ts
13
import {
24
DefaultCredentialProvider,
35
getDefaultRoleAssumer as StsGetDefaultRoleAssumer,

codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Please do not touch this file. It's generated from template:
2+
// https://github.com/aws/aws-sdk-js-v3/blob/main/codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen/sts-client-defaultStsRoleAssumers.ts
13
import { Credentials, Provider } from "@aws-sdk/types";
24

35
import { AssumeRoleCommand, AssumeRoleCommandInput } from "./commands/AssumeRoleCommand";
@@ -39,12 +41,15 @@ export const getDefaultRoleAssumer = (
3941
stsClientCtor: new (options: STSClientConfig) => STSClient
4042
): RoleAssumer => {
4143
let stsClient: STSClient;
44+
let closureSourceCreds: Credentials;
4245
return async (sourceCreds, params) => {
46+
closureSourceCreds = sourceCreds;
4347
if (!stsClient) {
4448
const { logger, region } = stsOptions;
4549
stsClient = new stsClientCtor({
4650
logger,
47-
credentials: sourceCreds,
51+
// A hack to make sts client uses the credential in current closure.
52+
credentialDefaultProvider: () => async () => closureSourceCreds,
4853
region: decorateDefaultRegion(region),
4954
});
5055
}

0 commit comments

Comments
 (0)