@cdk8s/awscdk-resolver 0.0.57 → 0.0.58

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.
Files changed (61) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +191 -1696
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-es/protocols/Aws_query.js +180 -1685
  5. package/node_modules/@aws-sdk/client-cloudformation/package.json +14 -14
  6. package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +9 -90
  7. package/node_modules/@aws-sdk/client-sso/dist-es/protocols/Aws_restJson1.js +8 -89
  8. package/node_modules/@aws-sdk/client-sso/package.json +11 -11
  9. package/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js +30 -135
  10. package/node_modules/@aws-sdk/client-sso-oidc/dist-es/protocols/Aws_restJson1.js +29 -134
  11. package/node_modules/@aws-sdk/client-sso-oidc/package.json +14 -14
  12. package/node_modules/@aws-sdk/client-sts/dist-cjs/index.js +74 -196
  13. package/node_modules/@aws-sdk/client-sts/dist-es/defaultStsRoleAssumers.js +17 -15
  14. package/node_modules/@aws-sdk/client-sts/dist-es/protocols/Aws_query.js +30 -178
  15. package/node_modules/@aws-sdk/client-sts/dist-types/defaultRoleAssumers.d.ts +4 -4
  16. package/node_modules/@aws-sdk/client-sts/dist-types/defaultStsRoleAssumers.d.ts +11 -3
  17. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultRoleAssumers.d.ts +4 -7
  18. package/node_modules/@aws-sdk/client-sts/dist-types/ts3.4/defaultStsRoleAssumers.d.ts +11 -3
  19. package/node_modules/@aws-sdk/client-sts/package.json +12 -12
  20. package/node_modules/@aws-sdk/core/CHANGELOG.md +11 -0
  21. package/node_modules/@aws-sdk/core/dist-cjs/index.js +13 -7
  22. package/node_modules/@aws-sdk/core/dist-es/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +6 -2
  23. package/node_modules/@aws-sdk/core/package.json +1 -1
  24. package/node_modules/@aws-sdk/core/src/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts +10 -2
  25. package/node_modules/@aws-sdk/core/tsconfig.cjs.tsbuildinfo +1 -1
  26. package/node_modules/@aws-sdk/core/tsconfig.es.tsbuildinfo +1 -1
  27. package/node_modules/@aws-sdk/core/tsconfig.types.tsbuildinfo +1 -1
  28. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  29. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  30. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +10 -2
  31. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveAssumeRoleCredentials.js +5 -1
  32. package/node_modules/@aws-sdk/credential-provider-ini/dist-es/resolveWebIdentityCredentials.js +1 -0
  33. package/node_modules/@aws-sdk/credential-provider-ini/package.json +7 -7
  34. package/node_modules/@aws-sdk/credential-provider-node/package.json +10 -9
  35. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  36. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  37. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/fromWebToken.js +28 -1
  38. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-es/fromWebToken.js +5 -1
  39. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  40. package/node_modules/@aws-sdk/middleware-host-header/package.json +2 -2
  41. package/node_modules/@aws-sdk/middleware-logger/package.json +2 -2
  42. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +2 -2
  43. package/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js +10 -2
  44. package/node_modules/@aws-sdk/middleware-signing/dist-es/awsAuthConfiguration.js +6 -2
  45. package/node_modules/@aws-sdk/middleware-signing/package.json +2 -2
  46. package/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  47. package/node_modules/@aws-sdk/region-config-resolver/package.json +2 -2
  48. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  49. package/node_modules/@aws-sdk/types/dist-types/credentials.d.ts +16 -0
  50. package/node_modules/@aws-sdk/types/dist-types/ts3.4/credentials.d.ts +3 -0
  51. package/node_modules/@aws-sdk/types/package.json +1 -1
  52. package/node_modules/@aws-sdk/util-endpoints/package.json +2 -2
  53. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +2 -2
  54. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  55. package/node_modules/@smithy/core/dist-cjs/index.js +26 -15
  56. package/node_modules/@smithy/core/dist-es/pagination/createPaginator.js +12 -1
  57. package/node_modules/@smithy/core/package.json +1 -1
  58. package/node_modules/@smithy/util-defaults-mode-node/dist-cjs/index.js +13 -3
  59. package/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js +1 -1
  60. package/node_modules/@smithy/util-defaults-mode-node/package.json +1 -1
  61. package/package.json +5 -5
@@ -1,18 +1,18 @@
1
+ import { partition } from "@aws-sdk/util-endpoints";
1
2
  import { AssumeRoleCommand } from "./commands/AssumeRoleCommand";
2
3
  import { AssumeRoleWithWebIdentityCommand, } from "./commands/AssumeRoleWithWebIdentityCommand";
3
4
  const ASSUME_ROLE_DEFAULT_REGION = "us-east-1";
4
- const decorateDefaultRegion = (region) => {
5
- if (typeof region !== "function") {
6
- return region === undefined ? ASSUME_ROLE_DEFAULT_REGION : region;
5
+ const resolveRegion = async (_region, _parentRegion, credentialProviderLogger) => {
6
+ const region = typeof _region === "function" ? await _region() : _region;
7
+ const parentRegion = typeof _parentRegion === "function" ? await _parentRegion() : _parentRegion;
8
+ if (!parentRegion || partition(parentRegion).name === "aws") {
9
+ credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
10
+ return region ?? ASSUME_ROLE_DEFAULT_REGION;
11
+ }
12
+ else {
13
+ credentialProviderLogger?.debug?.("@aws-sdk/client-sts::resolveRegion", "accepting first of:", `${region} (provider)`, `${parentRegion} (parent client)`, `${ASSUME_ROLE_DEFAULT_REGION} (STS default)`);
14
+ return region ?? parentRegion ?? ASSUME_ROLE_DEFAULT_REGION;
7
15
  }
8
- return async () => {
9
- try {
10
- return await region();
11
- }
12
- catch (e) {
13
- return ASSUME_ROLE_DEFAULT_REGION;
14
- }
15
- };
16
16
  };
17
17
  export const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => {
18
18
  let stsClient;
@@ -20,11 +20,12 @@ export const getDefaultRoleAssumer = (stsOptions, stsClientCtor) => {
20
20
  return async (sourceCreds, params) => {
21
21
  closureSourceCreds = sourceCreds;
22
22
  if (!stsClient) {
23
- const { logger, region, requestHandler } = stsOptions;
23
+ const { logger, region, requestHandler, credentialProviderLogger } = stsOptions;
24
+ const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
24
25
  stsClient = new stsClientCtor({
25
26
  logger,
26
27
  credentialDefaultProvider: () => async () => closureSourceCreds,
27
- region: decorateDefaultRegion(region || stsOptions.region),
28
+ region: resolvedRegion,
28
29
  ...(requestHandler ? { requestHandler } : {}),
29
30
  });
30
31
  }
@@ -45,10 +46,11 @@ export const getDefaultRoleAssumerWithWebIdentity = (stsOptions, stsClientCtor)
45
46
  let stsClient;
46
47
  return async (params) => {
47
48
  if (!stsClient) {
48
- const { logger, region, requestHandler } = stsOptions;
49
+ const { logger, region, requestHandler, credentialProviderLogger } = stsOptions;
50
+ const resolvedRegion = await resolveRegion(region, stsOptions?.parentClientConfig?.region, credentialProviderLogger);
49
51
  stsClient = new stsClientCtor({
50
52
  logger,
51
- region: decorateDefaultRegion(region || stsOptions.region),
53
+ region: resolvedRegion,
52
54
  ...(requestHandler ? { requestHandler } : {}),
53
55
  });
54
56
  }
@@ -85,7 +85,7 @@ export const se_GetSessionTokenCommand = async (input, context) => {
85
85
  };
86
86
  export const de_AssumeRoleCommand = async (output, context) => {
87
87
  if (output.statusCode >= 300) {
88
- return de_AssumeRoleCommandError(output, context);
88
+ return de_CommandError(output, context);
89
89
  }
90
90
  const data = await parseBody(output.body, context);
91
91
  let contents = {};
@@ -96,37 +96,9 @@ export const de_AssumeRoleCommand = async (output, context) => {
96
96
  };
97
97
  return response;
98
98
  };
99
- const de_AssumeRoleCommandError = async (output, context) => {
100
- const parsedOutput = {
101
- ...output,
102
- body: await parseErrorBody(output.body, context),
103
- };
104
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
105
- switch (errorCode) {
106
- case "ExpiredTokenException":
107
- case "com.amazonaws.sts#ExpiredTokenException":
108
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
109
- case "MalformedPolicyDocument":
110
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
111
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
112
- case "PackedPolicyTooLarge":
113
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
114
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
115
- case "RegionDisabledException":
116
- case "com.amazonaws.sts#RegionDisabledException":
117
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
118
- default:
119
- const parsedBody = parsedOutput.body;
120
- return throwDefaultError({
121
- output,
122
- parsedBody: parsedBody.Error,
123
- errorCode,
124
- });
125
- }
126
- };
127
99
  export const de_AssumeRoleWithSAMLCommand = async (output, context) => {
128
100
  if (output.statusCode >= 300) {
129
- return de_AssumeRoleWithSAMLCommandError(output, context);
101
+ return de_CommandError(output, context);
130
102
  }
131
103
  const data = await parseBody(output.body, context);
132
104
  let contents = {};
@@ -137,43 +109,9 @@ export const de_AssumeRoleWithSAMLCommand = async (output, context) => {
137
109
  };
138
110
  return response;
139
111
  };
140
- const de_AssumeRoleWithSAMLCommandError = async (output, context) => {
141
- const parsedOutput = {
142
- ...output,
143
- body: await parseErrorBody(output.body, context),
144
- };
145
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
146
- switch (errorCode) {
147
- case "ExpiredTokenException":
148
- case "com.amazonaws.sts#ExpiredTokenException":
149
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
150
- case "IDPRejectedClaim":
151
- case "com.amazonaws.sts#IDPRejectedClaimException":
152
- throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
153
- case "InvalidIdentityToken":
154
- case "com.amazonaws.sts#InvalidIdentityTokenException":
155
- throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
156
- case "MalformedPolicyDocument":
157
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
158
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
159
- case "PackedPolicyTooLarge":
160
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
161
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
162
- case "RegionDisabledException":
163
- case "com.amazonaws.sts#RegionDisabledException":
164
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
165
- default:
166
- const parsedBody = parsedOutput.body;
167
- return throwDefaultError({
168
- output,
169
- parsedBody: parsedBody.Error,
170
- errorCode,
171
- });
172
- }
173
- };
174
112
  export const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
175
113
  if (output.statusCode >= 300) {
176
- return de_AssumeRoleWithWebIdentityCommandError(output, context);
114
+ return de_CommandError(output, context);
177
115
  }
178
116
  const data = await parseBody(output.body, context);
179
117
  let contents = {};
@@ -184,46 +122,9 @@ export const de_AssumeRoleWithWebIdentityCommand = async (output, context) => {
184
122
  };
185
123
  return response;
186
124
  };
187
- const de_AssumeRoleWithWebIdentityCommandError = async (output, context) => {
188
- const parsedOutput = {
189
- ...output,
190
- body: await parseErrorBody(output.body, context),
191
- };
192
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
193
- switch (errorCode) {
194
- case "ExpiredTokenException":
195
- case "com.amazonaws.sts#ExpiredTokenException":
196
- throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
197
- case "IDPCommunicationError":
198
- case "com.amazonaws.sts#IDPCommunicationErrorException":
199
- throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
200
- case "IDPRejectedClaim":
201
- case "com.amazonaws.sts#IDPRejectedClaimException":
202
- throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
203
- case "InvalidIdentityToken":
204
- case "com.amazonaws.sts#InvalidIdentityTokenException":
205
- throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
206
- case "MalformedPolicyDocument":
207
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
208
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
209
- case "PackedPolicyTooLarge":
210
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
211
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
212
- case "RegionDisabledException":
213
- case "com.amazonaws.sts#RegionDisabledException":
214
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
215
- default:
216
- const parsedBody = parsedOutput.body;
217
- return throwDefaultError({
218
- output,
219
- parsedBody: parsedBody.Error,
220
- errorCode,
221
- });
222
- }
223
- };
224
125
  export const de_DecodeAuthorizationMessageCommand = async (output, context) => {
225
126
  if (output.statusCode >= 300) {
226
- return de_DecodeAuthorizationMessageCommandError(output, context);
127
+ return de_CommandError(output, context);
227
128
  }
228
129
  const data = await parseBody(output.body, context);
229
130
  let contents = {};
@@ -234,28 +135,9 @@ export const de_DecodeAuthorizationMessageCommand = async (output, context) => {
234
135
  };
235
136
  return response;
236
137
  };
237
- const de_DecodeAuthorizationMessageCommandError = async (output, context) => {
238
- const parsedOutput = {
239
- ...output,
240
- body: await parseErrorBody(output.body, context),
241
- };
242
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
243
- switch (errorCode) {
244
- case "InvalidAuthorizationMessageException":
245
- case "com.amazonaws.sts#InvalidAuthorizationMessageException":
246
- throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
247
- default:
248
- const parsedBody = parsedOutput.body;
249
- return throwDefaultError({
250
- output,
251
- parsedBody: parsedBody.Error,
252
- errorCode,
253
- });
254
- }
255
- };
256
138
  export const de_GetAccessKeyInfoCommand = async (output, context) => {
257
139
  if (output.statusCode >= 300) {
258
- return de_GetAccessKeyInfoCommandError(output, context);
140
+ return de_CommandError(output, context);
259
141
  }
260
142
  const data = await parseBody(output.body, context);
261
143
  let contents = {};
@@ -266,22 +148,9 @@ export const de_GetAccessKeyInfoCommand = async (output, context) => {
266
148
  };
267
149
  return response;
268
150
  };
269
- const de_GetAccessKeyInfoCommandError = async (output, context) => {
270
- const parsedOutput = {
271
- ...output,
272
- body: await parseErrorBody(output.body, context),
273
- };
274
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
275
- const parsedBody = parsedOutput.body;
276
- return throwDefaultError({
277
- output,
278
- parsedBody: parsedBody.Error,
279
- errorCode,
280
- });
281
- };
282
151
  export const de_GetCallerIdentityCommand = async (output, context) => {
283
152
  if (output.statusCode >= 300) {
284
- return de_GetCallerIdentityCommandError(output, context);
153
+ return de_CommandError(output, context);
285
154
  }
286
155
  const data = await parseBody(output.body, context);
287
156
  let contents = {};
@@ -292,22 +161,9 @@ export const de_GetCallerIdentityCommand = async (output, context) => {
292
161
  };
293
162
  return response;
294
163
  };
295
- const de_GetCallerIdentityCommandError = async (output, context) => {
296
- const parsedOutput = {
297
- ...output,
298
- body: await parseErrorBody(output.body, context),
299
- };
300
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
301
- const parsedBody = parsedOutput.body;
302
- return throwDefaultError({
303
- output,
304
- parsedBody: parsedBody.Error,
305
- errorCode,
306
- });
307
- };
308
164
  export const de_GetFederationTokenCommand = async (output, context) => {
309
165
  if (output.statusCode >= 300) {
310
- return de_GetFederationTokenCommandError(output, context);
166
+ return de_CommandError(output, context);
311
167
  }
312
168
  const data = await parseBody(output.body, context);
313
169
  let contents = {};
@@ -318,34 +174,9 @@ export const de_GetFederationTokenCommand = async (output, context) => {
318
174
  };
319
175
  return response;
320
176
  };
321
- const de_GetFederationTokenCommandError = async (output, context) => {
322
- const parsedOutput = {
323
- ...output,
324
- body: await parseErrorBody(output.body, context),
325
- };
326
- const errorCode = loadQueryErrorCode(output, parsedOutput.body);
327
- switch (errorCode) {
328
- case "MalformedPolicyDocument":
329
- case "com.amazonaws.sts#MalformedPolicyDocumentException":
330
- throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
331
- case "PackedPolicyTooLarge":
332
- case "com.amazonaws.sts#PackedPolicyTooLargeException":
333
- throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
334
- case "RegionDisabledException":
335
- case "com.amazonaws.sts#RegionDisabledException":
336
- throw await de_RegionDisabledExceptionRes(parsedOutput, context);
337
- default:
338
- const parsedBody = parsedOutput.body;
339
- return throwDefaultError({
340
- output,
341
- parsedBody: parsedBody.Error,
342
- errorCode,
343
- });
344
- }
345
- };
346
177
  export const de_GetSessionTokenCommand = async (output, context) => {
347
178
  if (output.statusCode >= 300) {
348
- return de_GetSessionTokenCommandError(output, context);
179
+ return de_CommandError(output, context);
349
180
  }
350
181
  const data = await parseBody(output.body, context);
351
182
  let contents = {};
@@ -356,16 +187,37 @@ export const de_GetSessionTokenCommand = async (output, context) => {
356
187
  };
357
188
  return response;
358
189
  };
359
- const de_GetSessionTokenCommandError = async (output, context) => {
190
+ const de_CommandError = async (output, context) => {
360
191
  const parsedOutput = {
361
192
  ...output,
362
193
  body: await parseErrorBody(output.body, context),
363
194
  };
364
195
  const errorCode = loadQueryErrorCode(output, parsedOutput.body);
365
196
  switch (errorCode) {
197
+ case "ExpiredTokenException":
198
+ case "com.amazonaws.sts#ExpiredTokenException":
199
+ throw await de_ExpiredTokenExceptionRes(parsedOutput, context);
200
+ case "MalformedPolicyDocument":
201
+ case "com.amazonaws.sts#MalformedPolicyDocumentException":
202
+ throw await de_MalformedPolicyDocumentExceptionRes(parsedOutput, context);
203
+ case "PackedPolicyTooLarge":
204
+ case "com.amazonaws.sts#PackedPolicyTooLargeException":
205
+ throw await de_PackedPolicyTooLargeExceptionRes(parsedOutput, context);
366
206
  case "RegionDisabledException":
367
207
  case "com.amazonaws.sts#RegionDisabledException":
368
208
  throw await de_RegionDisabledExceptionRes(parsedOutput, context);
209
+ case "IDPRejectedClaim":
210
+ case "com.amazonaws.sts#IDPRejectedClaimException":
211
+ throw await de_IDPRejectedClaimExceptionRes(parsedOutput, context);
212
+ case "InvalidIdentityToken":
213
+ case "com.amazonaws.sts#InvalidIdentityTokenException":
214
+ throw await de_InvalidIdentityTokenExceptionRes(parsedOutput, context);
215
+ case "IDPCommunicationError":
216
+ case "com.amazonaws.sts#IDPCommunicationErrorException":
217
+ throw await de_IDPCommunicationErrorExceptionRes(parsedOutput, context);
218
+ case "InvalidAuthorizationMessageException":
219
+ case "com.amazonaws.sts#InvalidAuthorizationMessageException":
220
+ throw await de_InvalidAuthorizationMessageExceptionRes(parsedOutput, context);
369
221
  default:
370
222
  const parsedBody = parsedOutput.body;
371
223
  return throwDefaultError({
@@ -1,14 +1,14 @@
1
1
  import { Pluggable } from "@smithy/types";
2
- import { DefaultCredentialProvider, RoleAssumer, RoleAssumerWithWebIdentity } from "./defaultStsRoleAssumers";
3
- import { ServiceInputTypes, ServiceOutputTypes, STSClientConfig } from "./STSClient";
2
+ import { DefaultCredentialProvider, RoleAssumer, RoleAssumerWithWebIdentity, STSRoleAssumerOptions } from "./defaultStsRoleAssumers";
3
+ import { ServiceInputTypes, ServiceOutputTypes } from "./STSClient";
4
4
  /**
5
5
  * The default role assumer that used by credential providers when sts:AssumeRole API is needed.
6
6
  */
7
- export declare const getDefaultRoleAssumer: (stsOptions?: Pick<STSClientConfig, "logger" | "region" | "requestHandler">, stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]) => RoleAssumer;
7
+ export declare const getDefaultRoleAssumer: (stsOptions?: STSRoleAssumerOptions, stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]) => RoleAssumer;
8
8
  /**
9
9
  * The default role assumer that used by credential providers when sts:AssumeRoleWithWebIdentity API is needed.
10
10
  */
11
- export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions?: Pick<STSClientConfig, "logger" | "region" | "requestHandler">, stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]) => RoleAssumerWithWebIdentity;
11
+ export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions?: STSRoleAssumerOptions, stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]) => RoleAssumerWithWebIdentity;
12
12
  /**
13
13
  * The default credential providers depend STS client to assume role with desired API: sts:assumeRole,
14
14
  * sts:assumeRoleWithWebIdentity, etc. This function decorates the default credential provider with role assumers which
@@ -1,7 +1,15 @@
1
- import { AwsCredentialIdentity, Provider } from "@smithy/types";
1
+ import type { CredentialProviderOptions } from "@aws-sdk/types";
2
+ import { AwsCredentialIdentity, Logger, Provider } from "@smithy/types";
2
3
  import { AssumeRoleCommandInput } from "./commands/AssumeRoleCommand";
3
4
  import { AssumeRoleWithWebIdentityCommandInput } from "./commands/AssumeRoleWithWebIdentityCommand";
4
5
  import type { STSClient, STSClientConfig } from "./STSClient";
6
+ /**
7
+ * @public
8
+ */
9
+ export type STSRoleAssumerOptions = Pick<STSClientConfig, "logger" | "region" | "requestHandler"> & {
10
+ credentialProviderLogger?: Logger;
11
+ parentClientConfig?: CredentialProviderOptions["parentClientConfig"];
12
+ };
5
13
  /**
6
14
  * @internal
7
15
  */
@@ -10,7 +18,7 @@ export type RoleAssumer = (sourceCreds: AwsCredentialIdentity, params: AssumeRol
10
18
  * The default role assumer that used by credential providers when sts:AssumeRole API is needed.
11
19
  * @internal
12
20
  */
13
- export declare const getDefaultRoleAssumer: (stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumer;
21
+ export declare const getDefaultRoleAssumer: (stsOptions: STSRoleAssumerOptions, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumer;
14
22
  /**
15
23
  * @internal
16
24
  */
@@ -19,7 +27,7 @@ export type RoleAssumerWithWebIdentity = (params: AssumeRoleWithWebIdentityComma
19
27
  * The default role assumer that used by credential providers when sts:AssumeRoleWithWebIdentity API is needed.
20
28
  * @internal
21
29
  */
22
- export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumerWithWebIdentity;
30
+ export declare const getDefaultRoleAssumerWithWebIdentity: (stsOptions: STSRoleAssumerOptions, stsClientCtor: new (options: STSClientConfig) => STSClient) => RoleAssumerWithWebIdentity;
23
31
  /**
24
32
  * @internal
25
33
  */
@@ -3,18 +3,15 @@ import {
3
3
  DefaultCredentialProvider,
4
4
  RoleAssumer,
5
5
  RoleAssumerWithWebIdentity,
6
+ STSRoleAssumerOptions,
6
7
  } from "./defaultStsRoleAssumers";
7
- import {
8
- ServiceInputTypes,
9
- ServiceOutputTypes,
10
- STSClientConfig,
11
- } from "./STSClient";
8
+ import { ServiceInputTypes, ServiceOutputTypes } from "./STSClient";
12
9
  export declare const getDefaultRoleAssumer: (
13
- stsOptions?: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
10
+ stsOptions?: STSRoleAssumerOptions,
14
11
  stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]
15
12
  ) => RoleAssumer;
16
13
  export declare const getDefaultRoleAssumerWithWebIdentity: (
17
- stsOptions?: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
14
+ stsOptions?: STSRoleAssumerOptions,
18
15
  stsPlugins?: Pluggable<ServiceInputTypes, ServiceOutputTypes>[]
19
16
  ) => RoleAssumerWithWebIdentity;
20
17
  export declare const decorateDefaultCredentialProvider: (
@@ -1,20 +1,28 @@
1
- import { AwsCredentialIdentity, Provider } from "@smithy/types";
1
+ import { CredentialProviderOptions } from "@aws-sdk/types";
2
+ import { AwsCredentialIdentity, Logger, Provider } from "@smithy/types";
2
3
  import { AssumeRoleCommandInput } from "./commands/AssumeRoleCommand";
3
4
  import { AssumeRoleWithWebIdentityCommandInput } from "./commands/AssumeRoleWithWebIdentityCommand";
4
5
  import { STSClient, STSClientConfig } from "./STSClient";
6
+ export type STSRoleAssumerOptions = Pick<
7
+ STSClientConfig,
8
+ "logger" | "region" | "requestHandler"
9
+ > & {
10
+ credentialProviderLogger?: Logger;
11
+ parentClientConfig?: CredentialProviderOptions["parentClientConfig"];
12
+ };
5
13
  export type RoleAssumer = (
6
14
  sourceCreds: AwsCredentialIdentity,
7
15
  params: AssumeRoleCommandInput
8
16
  ) => Promise<AwsCredentialIdentity>;
9
17
  export declare const getDefaultRoleAssumer: (
10
- stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
18
+ stsOptions: STSRoleAssumerOptions,
11
19
  stsClientCtor: new (options: STSClientConfig) => STSClient
12
20
  ) => RoleAssumer;
13
21
  export type RoleAssumerWithWebIdentity = (
14
22
  params: AssumeRoleWithWebIdentityCommandInput
15
23
  ) => Promise<AwsCredentialIdentity>;
16
24
  export declare const getDefaultRoleAssumerWithWebIdentity: (
17
- stsOptions: Pick<STSClientConfig, "logger" | "region" | "requestHandler">,
25
+ stsOptions: STSRoleAssumerOptions,
18
26
  stsClientCtor: new (options: STSClientConfig) => STSClient
19
27
  ) => RoleAssumerWithWebIdentity;
20
28
  export type DefaultCredentialProvider = (
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sts",
3
3
  "description": "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
4
- "version": "3.504.0",
4
+ "version": "3.511.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-sts",
@@ -22,16 +22,16 @@
22
22
  "dependencies": {
23
23
  "@aws-crypto/sha256-browser": "3.0.0",
24
24
  "@aws-crypto/sha256-js": "3.0.0",
25
- "@aws-sdk/core": "3.496.0",
26
- "@aws-sdk/middleware-host-header": "3.502.0",
27
- "@aws-sdk/middleware-logger": "3.502.0",
28
- "@aws-sdk/middleware-recursion-detection": "3.502.0",
29
- "@aws-sdk/middleware-user-agent": "3.502.0",
30
- "@aws-sdk/region-config-resolver": "3.502.0",
31
- "@aws-sdk/types": "3.502.0",
32
- "@aws-sdk/util-endpoints": "3.502.0",
33
- "@aws-sdk/util-user-agent-browser": "3.502.0",
34
- "@aws-sdk/util-user-agent-node": "3.502.0",
25
+ "@aws-sdk/core": "3.511.0",
26
+ "@aws-sdk/middleware-host-header": "3.511.0",
27
+ "@aws-sdk/middleware-logger": "3.511.0",
28
+ "@aws-sdk/middleware-recursion-detection": "3.511.0",
29
+ "@aws-sdk/middleware-user-agent": "3.511.0",
30
+ "@aws-sdk/region-config-resolver": "3.511.0",
31
+ "@aws-sdk/types": "3.511.0",
32
+ "@aws-sdk/util-endpoints": "3.511.0",
33
+ "@aws-sdk/util-user-agent-browser": "3.511.0",
34
+ "@aws-sdk/util-user-agent-node": "3.511.0",
35
35
  "@smithy/config-resolver": "^2.1.1",
36
36
  "@smithy/core": "^1.3.1",
37
37
  "@smithy/fetch-http-handler": "^2.4.1",
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "license": "Apache-2.0",
90
90
  "peerDependencies": {
91
- "@aws-sdk/credential-provider-node": "^3.504.0"
91
+ "@aws-sdk/credential-provider-node": "^3.511.0"
92
92
  },
93
93
  "browser": {
94
94
  "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.511.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.510.0...v3.511.0) (2024-02-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **credential-provider-node:** pass client region to inner credential client region ([#5758](https://github.com/aws/aws-sdk-js-v3/issues/5758)) ([8c0b29e](https://github.com/aws/aws-sdk-js-v3/commit/8c0b29eabfe0ce8dbd2cbdcfb8b0a31b003bc3f2))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.496.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.495.0...v3.496.0) (2024-01-19)
7
18
 
8
19
 
@@ -154,7 +154,13 @@ var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
154
154
  }
155
155
  if (!normalizedCreds) {
156
156
  if (config.credentialDefaultProvider) {
157
- normalizedCreds = (0, import_core.normalizeProvider)(config.credentialDefaultProvider(config));
157
+ normalizedCreds = (0, import_core.normalizeProvider)(
158
+ config.credentialDefaultProvider(
159
+ Object.assign({}, config, {
160
+ parentClientConfig: config
161
+ })
162
+ )
163
+ );
158
164
  } else {
159
165
  normalizedCreds = /* @__PURE__ */ __name(async () => {
160
166
  throw new Error("`credentials` is missing");
@@ -303,14 +309,14 @@ var awsExpectUnion = /* @__PURE__ */ __name((value) => {
303
309
  // Annotate the CommonJS export names for ESM import in node:
304
310
 
305
311
  0 && (module.exports = {
306
- AWSSDKSigV4Signer,
312
+ emitWarningIfUnsupportedVersion,
307
313
  AwsSdkSigV4Signer,
314
+ AWSSDKSigV4Signer,
315
+ resolveAwsSdkSigV4Config,
316
+ resolveAWSSDKSigV4Config,
317
+ _toStr,
308
318
  _toBool,
309
319
  _toNum,
310
- _toStr,
311
- awsExpectUnion,
312
- emitWarningIfUnsupportedVersion,
313
- resolveAWSSDKSigV4Config,
314
- resolveAwsSdkSigV4Config
320
+ awsExpectUnion
315
321
  });
316
322
 
@@ -7,10 +7,14 @@ export const resolveAwsSdkSigV4Config = (config) => {
7
7
  }
8
8
  if (!normalizedCreds) {
9
9
  if (config.credentialDefaultProvider) {
10
- normalizedCreds = normalizeProvider(config.credentialDefaultProvider(config));
10
+ normalizedCreds = normalizeProvider(config.credentialDefaultProvider(Object.assign({}, config, {
11
+ parentClientConfig: config,
12
+ })));
11
13
  }
12
14
  else {
13
- normalizedCreds = async () => { throw new Error("`credentials` is missing"); };
15
+ normalizedCreds = async () => {
16
+ throw new Error("`credentials` is missing");
17
+ };
14
18
  }
15
19
  }
16
20
  const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256, } = config;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.496.0",
3
+ "version": "3.511.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
@@ -111,9 +111,17 @@ export const resolveAwsSdkSigV4Config = <T>(
111
111
  // credentialDefaultProvider should always be populated, but in case
112
112
  // it isn't, set a default identity provider that throws an error
113
113
  if (config.credentialDefaultProvider) {
114
- normalizedCreds = normalizeProvider(config.credentialDefaultProvider(config as any));
114
+ normalizedCreds = normalizeProvider(
115
+ config.credentialDefaultProvider(
116
+ Object.assign({}, config as any, {
117
+ parentClientConfig: config,
118
+ })
119
+ )
120
+ );
115
121
  } else {
116
- normalizedCreds = async () => { throw new Error("`credentials` is missing") };
122
+ normalizedCreds = async () => {
123
+ throw new Error("`credentials` is missing");
124
+ };
117
125
  }
118
126
  }
119
127