@aws-sdk/credential-provider-cognito-identity 3.713.0 → 3.716.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-cjs/index.js CHANGED
@@ -71,9 +71,13 @@ __name(resolveLogins, "resolveLogins");
71
71
  // src/fromCognitoIdentity.ts
72
72
  function fromCognitoIdentity(parameters) {
73
73
  return async (awsIdentityProperties) => {
74
- var _a, _b, _c, _d;
74
+ var _a;
75
75
  (_a = parameters.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
76
76
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
77
+ const fromConfigs = /* @__PURE__ */ __name((property) => {
78
+ var _a2, _b, _c;
79
+ return ((_a2 = parameters.clientConfig) == null ? void 0 : _a2[property]) ?? ((_b = parameters.parentClientConfig) == null ? void 0 : _b[property]) ?? ((_c = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _c[property]);
80
+ }, "fromConfigs");
77
81
  const {
78
82
  Credentials: {
79
83
  AccessKeyId = throwOnMissingAccessKeyId(parameters.logger),
@@ -83,7 +87,8 @@ function fromCognitoIdentity(parameters) {
83
87
  } = throwOnMissingCredentials(parameters.logger)
84
88
  } = await (parameters.client ?? new CognitoIdentityClient2(
85
89
  Object.assign({}, parameters.clientConfig ?? {}, {
86
- region: ((_b = parameters.clientConfig) == null ? void 0 : _b.region) ?? ((_c = parameters.parentClientConfig) == null ? void 0 : _c.region) ?? ((_d = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _d.region)
90
+ region: fromConfigs("region"),
91
+ profile: fromConfigs("profile")
87
92
  })
88
93
  )).send(
89
94
  new GetCredentialsForIdentityCommand2({
@@ -239,11 +244,15 @@ function fromCognitoIdentityPool({
239
244
  logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
240
245
  const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : void 0;
241
246
  let provider = /* @__PURE__ */ __name(async (awsIdentityProperties) => {
242
- var _a;
243
247
  const { GetIdCommand: GetIdCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
248
+ const fromConfigs = /* @__PURE__ */ __name((property) => {
249
+ var _a;
250
+ return (clientConfig == null ? void 0 : clientConfig[property]) ?? (parentClientConfig == null ? void 0 : parentClientConfig[property]) ?? ((_a = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _a[property]);
251
+ }, "fromConfigs");
244
252
  const _client = client ?? new CognitoIdentityClient2(
245
253
  Object.assign({}, clientConfig ?? {}, {
246
- region: (clientConfig == null ? void 0 : clientConfig.region) ?? (parentClientConfig == null ? void 0 : parentClientConfig.region) ?? ((_a = awsIdentityProperties == null ? void 0 : awsIdentityProperties.callerClientConfig) == null ? void 0 : _a.region)
254
+ region: fromConfigs("region"),
255
+ profile: fromConfigs("profile")
247
256
  })
248
257
  );
249
258
  let identityId = cacheKey && await cache.getItem(cacheKey);
@@ -4,11 +4,13 @@ export function fromCognitoIdentity(parameters) {
4
4
  return async (awsIdentityProperties) => {
5
5
  parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
6
6
  const { GetCredentialsForIdentityCommand, CognitoIdentityClient } = await import("./loadCognitoIdentity");
7
+ const fromConfigs = (property) => parameters.clientConfig?.[property] ??
8
+ parameters.parentClientConfig?.[property] ??
9
+ awsIdentityProperties?.callerClientConfig?.[property];
7
10
  const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters.logger), SessionToken, } = throwOnMissingCredentials(parameters.logger), } = await (parameters.client ??
8
11
  new CognitoIdentityClient(Object.assign({}, parameters.clientConfig ?? {}, {
9
- region: parameters.clientConfig?.region ??
10
- parameters.parentClientConfig?.region ??
11
- awsIdentityProperties?.callerClientConfig?.region,
12
+ region: fromConfigs("region"),
13
+ profile: fromConfigs("profile"),
12
14
  }))).send(new GetCredentialsForIdentityCommand({
13
15
  CustomRoleArn: parameters.customRoleArn,
14
16
  IdentityId: parameters.identityId,
@@ -9,9 +9,13 @@ export function fromCognitoIdentityPool({ accountId, cache = localStorage(), cli
9
9
  : undefined;
10
10
  let provider = async (awsIdentityProperties) => {
11
11
  const { GetIdCommand, CognitoIdentityClient } = await import("./loadCognitoIdentity");
12
+ const fromConfigs = (property) => clientConfig?.[property] ??
13
+ parentClientConfig?.[property] ??
14
+ awsIdentityProperties?.callerClientConfig?.[property];
12
15
  const _client = client ??
13
16
  new CognitoIdentityClient(Object.assign({}, clientConfig ?? {}, {
14
- region: clientConfig?.region ?? parentClientConfig?.region ?? awsIdentityProperties?.callerClientConfig?.region,
17
+ region: fromConfigs("region"),
18
+ profile: fromConfigs("profile"),
15
19
  }));
16
20
  let identityId = (cacheKey && (await cache.getItem(cacheKey)));
17
21
  if (!identityId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-cognito-identity",
3
- "version": "3.713.0",
3
+ "version": "3.716.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline credential-provider-cognito-identity",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/client-cognito-identity": "3.713.0",
28
- "@aws-sdk/types": "3.713.0",
27
+ "@aws-sdk/client-cognito-identity": "3.716.0",
28
+ "@aws-sdk/types": "3.714.0",
29
29
  "@smithy/property-provider": "^3.1.11",
30
30
  "@smithy/types": "^3.7.2",
31
31
  "tslib": "^2.6.2"