Skip to content

Commit 426f92c

Browse files
committed
fix(core): sigv4ConfigResolver access client creds to instantiate signer
1 parent 6040d17 commit 426f92c

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

clients/client-sts/src/STSClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class STSClient extends __Client<
323323
const _config_4 = resolveRegionConfig(_config_3);
324324
const _config_5 = resolveHostHeaderConfig(_config_4);
325325
const _config_6 = resolveEndpointConfig(_config_5);
326-
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
326+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6, { client: () => this });
327327
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
328328
super(_config_8);
329329
this.config = _config_8;

clients/client-sts/src/auth/httpAuthSchemeProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ export interface HttpAuthSchemeResolvedConfig extends StsAuthResolvedConfig, Aws
158158
* @internal
159159
*/
160160
export const resolveHttpAuthSchemeConfig = <T>(
161-
config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved
161+
config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved,
162+
{ client }: { client: () => { config: AwsSdkSigV4AuthResolvedConfig } }
162163
): T & HttpAuthSchemeResolvedConfig => {
163164
const config_0 = resolveStsAuthConfig(config);
164-
const config_1 = resolveAwsSdkSigV4Config(config_0);
165+
const config_1 = resolveAwsSdkSigV4Config(config_0, client());
165166
return {
166167
...config_1,
167168
} as T & HttpAuthSchemeResolvedConfig;

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/auth/http/integration/AwsSdkCustomizeSigV4Auth.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ public void customizeSupportedHttpAuthSchemes(
185185
.namespace(AwsDependency.AWS_SDK_CORE.getPackageName(), "/")
186186
.addDependency(AwsDependency.AWS_SDK_CORE)
187187
.build())
188+
.addArgs(List.of("client()"))
188189
.inputConfig(Symbol.builder()
189190
.name("AwsSdkSigV4AuthInputConfig")
190191
.namespace(AwsDependency.AWS_SDK_CORE.getPackageName(), "/")

packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ export interface AwsSdkSigV4AuthResolvedConfig {
102102
* @internal
103103
*/
104104
export const resolveAwsSdkSigV4Config = <T>(
105-
config: T & AwsSdkSigV4AuthInputConfig & AwsSdkSigV4PreviouslyResolved
105+
config: T & AwsSdkSigV4AuthInputConfig & AwsSdkSigV4PreviouslyResolved,
106+
client?: {
107+
config: AwsSdkSigV4AuthResolvedConfig;
108+
}
106109
): T & AwsSdkSigV4AuthResolvedConfig => {
107110
let isUserSupplied = false;
108111
// Normalize credentials
@@ -208,7 +211,7 @@ export const resolveAwsSdkSigV4Config = <T>(
208211

209212
const params: SignatureV4Init & SignatureV4CryptoInit = {
210213
...config,
211-
credentials: boundCredentialsProvider,
214+
credentials: client?.config.credentials ?? boundCredentialsProvider,
212215
region: config.signingRegion,
213216
service: config.signingName,
214217
sha256,

0 commit comments

Comments
 (0)