diff --git a/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts b/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts index ba3fd5117e5f..61351e90a10c 100644 --- a/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +++ b/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts @@ -129,8 +129,8 @@ export const resolveAwsSdkSigV4Config = ( } } - const contextBoundCredentialsProvider = async () => { - return credentialsProvider!({ contextClientConfig: config }); + const boundCredentialsProvider = async () => { + return credentialsProvider!({ callerClientConfig: config }); }; // Populate sigv4 arguments @@ -174,7 +174,7 @@ export const resolveAwsSdkSigV4Config = ( const params: SignatureV4Init & SignatureV4CryptoInit = { ...config, - credentials: contextBoundCredentialsProvider, + credentials: boundCredentialsProvider, region: config.signingRegion, service: config.signingName, sha256, @@ -210,7 +210,7 @@ export const resolveAwsSdkSigV4Config = ( const params: SignatureV4Init & SignatureV4CryptoInit = { ...config, - credentials: contextBoundCredentialsProvider, + credentials: boundCredentialsProvider, region: config.signingRegion, service: config.signingName, sha256, @@ -228,10 +228,10 @@ export const resolveAwsSdkSigV4Config = ( signingEscapePath, credentials: isUserSupplied ? async () => - contextBoundCredentialsProvider!().then((creds: AttributedAwsCredentialIdentity) => + boundCredentialsProvider!().then((creds: AttributedAwsCredentialIdentity) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e") ) - : contextBoundCredentialsProvider!, + : boundCredentialsProvider!, signer, }; }; diff --git a/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts b/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts index 389228053a71..db5e1b745ad4 100644 --- a/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts +++ b/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts @@ -47,7 +47,7 @@ export function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): region: parameters.clientConfig?.region ?? parameters.parentClientConfig?.region ?? - awsIdentityProperties?.contextClientConfig?.region, + awsIdentityProperties?.callerClientConfig?.region, }) ) ).send( diff --git a/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts b/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts index 061b02dc45f3..2cf4d5f12293 100644 --- a/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts +++ b/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts @@ -42,7 +42,7 @@ export function fromCognitoIdentityPool({ new CognitoIdentityClient( Object.assign({}, clientConfig ?? {}, { region: - clientConfig?.region ?? parentClientConfig?.region ?? awsIdentityProperties?.contextClientConfig?.region, + clientConfig?.region ?? parentClientConfig?.region ?? awsIdentityProperties?.callerClientConfig?.region, }) ); diff --git a/packages/credential-provider-ini/src/fromIni.ts b/packages/credential-provider-ini/src/fromIni.ts index 795a4aa7ed55..9f6de87c5f85 100644 --- a/packages/credential-provider-ini/src/fromIni.ts +++ b/packages/credential-provider-ini/src/fromIni.ts @@ -57,13 +57,13 @@ export interface FromIniInit extends SourceProfileInit, CredentialProviderOption */ export const fromIni = (_init: FromIniInit = {}): RegionalAwsCredentialIdentityProvider => - async ({ contextClientConfig } = {}) => { + async ({ callerClientConfig } = {}) => { const init: FromIniInit = { ..._init, }; - if (contextClientConfig?.region) { + if (callerClientConfig?.region) { init.parentClientConfig = { - region: contextClientConfig.region, + region: callerClientConfig.region, ..._init.parentClientConfig, }; } diff --git a/packages/credential-provider-web-identity/src/fromWebToken.ts b/packages/credential-provider-web-identity/src/fromWebToken.ts index 1650113733ff..d2edd9ca6cc1 100644 --- a/packages/credential-provider-web-identity/src/fromWebToken.ts +++ b/packages/credential-provider-web-identity/src/fromWebToken.ts @@ -169,10 +169,10 @@ export const fromWebToken = { ...init.clientConfig, credentialProviderLogger: init.logger, - ...(awsIdentityProperties?.contextClientConfig?.region || init.parentClientConfig + ...(awsIdentityProperties?.callerClientConfig?.region || init.parentClientConfig ? { parentClientConfig: { - region: awsIdentityProperties?.contextClientConfig?.region, + region: awsIdentityProperties?.callerClientConfig?.region, ...init.parentClientConfig, }, } diff --git a/packages/middleware-signing/src/awsAuthConfiguration.ts b/packages/middleware-signing/src/awsAuthConfiguration.ts index 1130754f8053..12313d69b0b5 100644 --- a/packages/middleware-signing/src/awsAuthConfiguration.ts +++ b/packages/middleware-signing/src/awsAuthConfiguration.ts @@ -328,7 +328,7 @@ const createConfigBoundCredentialProvider = (input: { ); const normalizedCreds = async () => (normalizedCredentialsProvider as RegionalAwsCredentialIdentityProvider)({ - contextClientConfig: { + callerClientConfig: { region: normalizeProvider(input.region), }, }); diff --git a/packages/token-providers/src/fromSso.ts b/packages/token-providers/src/fromSso.ts index 516b4efea1ca..0f973dd8787c 100644 --- a/packages/token-providers/src/fromSso.ts +++ b/packages/token-providers/src/fromSso.ts @@ -40,10 +40,10 @@ export const fromSso = async (awsIdentityProperties?: AwsIdentityProperties) => { const init: FromSsoInit = { ..._init, - ...(awsIdentityProperties?.contextClientConfig?.region + ...(awsIdentityProperties?.callerClientConfig?.region ? { parentClientConfig: { - region: awsIdentityProperties?.contextClientConfig?.region, + region: awsIdentityProperties?.callerClientConfig?.region, ..._init.parentClientConfig, }, } diff --git a/packages/types/src/identity/AwsCredentialIdentity.ts b/packages/types/src/identity/AwsCredentialIdentity.ts index c720f09620de..0af1dcfb22d2 100644 --- a/packages/types/src/identity/AwsCredentialIdentity.ts +++ b/packages/types/src/identity/AwsCredentialIdentity.ts @@ -8,7 +8,7 @@ export { AwsCredentialIdentity, AwsCredentialIdentityProvider, IdentityProvider * @public */ export interface AwsIdentityProperties { - contextClientConfig?: { + callerClientConfig?: { region(): Promise; }; }