From 5bc2b69448894ef3e5a40c520cf75b4fb35866de Mon Sep 17 00:00:00 2001 From: George Fu Date: Thu, 12 Dec 2024 20:08:02 +0000 Subject: [PATCH] feat(credential-providers): rename contextClientConfig to callerClientConfig --- .../httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts | 2 +- .../src/fromCognitoIdentity.ts | 2 +- .../src/fromCognitoIdentityPool.ts | 2 +- packages/credential-provider-ini/src/fromIni.ts | 6 +++--- .../credential-provider-web-identity/src/fromWebToken.ts | 4 ++-- packages/middleware-signing/src/awsAuthConfiguration.ts | 2 +- packages/token-providers/src/fromSso.ts | 4 ++-- packages/types/src/identity/AwsCredentialIdentity.ts | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts b/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts index ba3fd5117e5f..39952d4ce3cc 100644 --- a/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +++ b/packages/core/src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts @@ -130,7 +130,7 @@ export const resolveAwsSdkSigV4Config = ( } const contextBoundCredentialsProvider = async () => { - return credentialsProvider!({ contextClientConfig: config }); + return credentialsProvider!({ callerClientConfig: config }); }; // Populate sigv4 arguments 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; }; }