@mavogel/awscdk-rootmail 0.0.114 → 0.0.115

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 (92) hide show
  1. package/.jsii +9 -9
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +5 -5
  5. package/node_modules/@aws-sdk/client-route-53/package.json +5 -5
  6. package/node_modules/@aws-sdk/client-s3/dist-cjs/auth/httpAuthSchemeProvider.js +126 -0
  7. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +67 -13
  8. package/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js +15 -0
  9. package/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js +15 -6
  10. package/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  11. package/node_modules/@aws-sdk/client-s3/dist-es/auth/httpAuthSchemeProvider.js +122 -0
  12. package/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js +15 -0
  13. package/node_modules/@aws-sdk/client-s3/dist-es/runtimeExtensions.js +3 -0
  14. package/node_modules/@aws-sdk/client-s3/dist-types/S3Client.d.ts +15 -14
  15. package/node_modules/@aws-sdk/client-s3/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  16. package/node_modules/@aws-sdk/client-s3/dist-types/auth/httpAuthSchemeProvider.d.ts +69 -0
  17. package/node_modules/@aws-sdk/client-s3/dist-types/extensionConfiguration.d.ts +2 -1
  18. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.browser.d.ts +6 -4
  19. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.d.ts +4 -2
  20. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.native.d.ts +6 -4
  21. package/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.shared.d.ts +2 -0
  22. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3Client.d.ts +13 -15
  23. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  24. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +46 -0
  25. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  26. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.browser.d.ts +6 -6
  27. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.d.ts +4 -4
  28. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.native.d.ts +6 -6
  29. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  30. package/node_modules/@aws-sdk/client-s3/package.json +9 -9
  31. package/node_modules/@aws-sdk/client-ses/package.json +5 -5
  32. package/node_modules/@aws-sdk/client-ssm/package.json +5 -5
  33. package/node_modules/@aws-sdk/client-sso/package.json +2 -2
  34. package/node_modules/@aws-sdk/client-sso-oidc/package.json +4 -4
  35. package/node_modules/@aws-sdk/client-sts/package.json +4 -4
  36. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +16 -3
  37. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +11 -1
  38. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js +1 -1
  39. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/index.d.ts +1 -1
  40. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/aws_sdk/index.d.ts +5 -1
  41. package/node_modules/@aws-sdk/core/package.json +1 -1
  42. package/node_modules/@aws-sdk/credential-provider-ini/package.json +3 -3
  43. package/node_modules/@aws-sdk/credential-provider-node/package.json +3 -3
  44. package/node_modules/@aws-sdk/credential-provider-sso/package.json +2 -2
  45. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +92 -10
  46. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js +24 -10
  47. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js +39 -0
  48. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js +7 -0
  49. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/index.js +1 -0
  50. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/s3-express/functions/s3ExpressHttpSigningMiddleware.d.ts +27 -0
  51. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/s3-express/functions/signS3Express.d.ts +13 -0
  52. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/s3-express/index.d.ts +1 -0
  53. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/s3-express/functions/s3ExpressHttpSigningMiddleware.d.ts +40 -0
  54. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/s3-express/functions/signS3Express.d.ts +27 -0
  55. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-types/ts3.4/s3-express/index.d.ts +5 -0
  56. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +4 -1
  57. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  58. package/node_modules/cdk-nag/.jsii +2 -2
  59. package/node_modules/cdk-nag/lib/ignore-suppression-conditions.js +5 -5
  60. package/node_modules/cdk-nag/lib/nag-logger.js +2 -2
  61. package/node_modules/cdk-nag/lib/nag-pack.js +1 -1
  62. package/node_modules/cdk-nag/lib/nag-rules.js +1 -1
  63. package/node_modules/cdk-nag/lib/nag-suppressions.js +1 -1
  64. package/node_modules/cdk-nag/lib/packs/aws-solutions.js +1 -1
  65. package/node_modules/cdk-nag/lib/packs/hipaa-security.js +1 -1
  66. package/node_modules/cdk-nag/lib/packs/nist-800-53-r4.js +1 -1
  67. package/node_modules/cdk-nag/lib/packs/nist-800-53-r5.js +1 -1
  68. package/node_modules/cdk-nag/lib/packs/pci-dss-321.js +1 -1
  69. package/node_modules/cdk-nag/package.json +1 -1
  70. package/package.json +7 -7
  71. package/node_modules/@aws-sdk/middleware-signing/LICENSE +0 -201
  72. package/node_modules/@aws-sdk/middleware-signing/README.md +0 -4
  73. package/node_modules/@aws-sdk/middleware-signing/dist-cjs/index.js +0 -269
  74. package/node_modules/@aws-sdk/middleware-signing/dist-es/awsAuthConfiguration.js +0 -115
  75. package/node_modules/@aws-sdk/middleware-signing/dist-es/awsAuthMiddleware.js +0 -81
  76. package/node_modules/@aws-sdk/middleware-signing/dist-es/index.js +0 -2
  77. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getSkewCorrectedDate.js +0 -1
  78. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/getUpdatedSystemClockOffset.js +0 -8
  79. package/node_modules/@aws-sdk/middleware-signing/dist-es/utils/isClockSkewed.js +0 -2
  80. package/node_modules/@aws-sdk/middleware-signing/dist-types/awsAuthConfiguration.d.ts +0 -99
  81. package/node_modules/@aws-sdk/middleware-signing/dist-types/awsAuthMiddleware.d.ts +0 -6
  82. package/node_modules/@aws-sdk/middleware-signing/dist-types/index.d.ts +0 -2
  83. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/awsAuthConfiguration.d.ts +0 -68
  84. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/awsAuthMiddleware.d.ts +0 -19
  85. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/index.d.ts +0 -2
  86. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getSkewCorrectedDate.d.ts +0 -1
  87. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/getUpdatedSystemClockOffset.d.ts +0 -4
  88. package/node_modules/@aws-sdk/middleware-signing/dist-types/ts3.4/utils/isClockSkewed.d.ts +0 -4
  89. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getSkewCorrectedDate.d.ts +0 -6
  90. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/getUpdatedSystemClockOffset.d.ts +0 -8
  91. package/node_modules/@aws-sdk/middleware-signing/dist-types/utils/isClockSkewed.d.ts +0 -7
  92. package/node_modules/@aws-sdk/middleware-signing/package.json +0 -59
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ses",
3
3
  "description": "AWS SDK for JavaScript Ses Client for Node.js, Browser and React Native",
4
- "version": "3.623.0",
4
+ "version": "3.624.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-ses",
@@ -20,10 +20,10 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/client-sso-oidc": "3.623.0",
24
- "@aws-sdk/client-sts": "3.623.0",
25
- "@aws-sdk/core": "3.623.0",
26
- "@aws-sdk/credential-provider-node": "3.623.0",
23
+ "@aws-sdk/client-sso-oidc": "3.624.0",
24
+ "@aws-sdk/client-sts": "3.624.0",
25
+ "@aws-sdk/core": "3.624.0",
26
+ "@aws-sdk/credential-provider-node": "3.624.0",
27
27
  "@aws-sdk/middleware-host-header": "3.620.0",
28
28
  "@aws-sdk/middleware-logger": "3.609.0",
29
29
  "@aws-sdk/middleware-recursion-detection": "3.620.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ssm",
3
3
  "description": "AWS SDK for JavaScript Ssm Client for Node.js, Browser and React Native",
4
- "version": "3.623.0",
4
+ "version": "3.624.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-ssm",
@@ -20,10 +20,10 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/client-sso-oidc": "3.623.0",
24
- "@aws-sdk/client-sts": "3.623.0",
25
- "@aws-sdk/core": "3.623.0",
26
- "@aws-sdk/credential-provider-node": "3.623.0",
23
+ "@aws-sdk/client-sso-oidc": "3.624.0",
24
+ "@aws-sdk/client-sts": "3.624.0",
25
+ "@aws-sdk/core": "3.624.0",
26
+ "@aws-sdk/credential-provider-node": "3.624.0",
27
27
  "@aws-sdk/middleware-host-header": "3.620.0",
28
28
  "@aws-sdk/middleware-logger": "3.609.0",
29
29
  "@aws-sdk/middleware-recursion-detection": "3.620.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sso",
3
3
  "description": "AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",
4
- "version": "3.623.0",
4
+ "version": "3.624.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-sso",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.623.0",
23
+ "@aws-sdk/core": "3.624.0",
24
24
  "@aws-sdk/middleware-host-header": "3.620.0",
25
25
  "@aws-sdk/middleware-logger": "3.609.0",
26
26
  "@aws-sdk/middleware-recursion-detection": "3.620.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sso-oidc",
3
3
  "description": "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
4
- "version": "3.623.0",
4
+ "version": "3.624.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-sso-oidc",
@@ -20,8 +20,8 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.623.0",
24
- "@aws-sdk/credential-provider-node": "3.623.0",
23
+ "@aws-sdk/core": "3.624.0",
24
+ "@aws-sdk/credential-provider-node": "3.624.0",
25
25
  "@aws-sdk/middleware-host-header": "3.620.0",
26
26
  "@aws-sdk/middleware-logger": "3.609.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.620.0",
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "license": "Apache-2.0",
87
87
  "peerDependencies": {
88
- "@aws-sdk/client-sts": "^3.623.0"
88
+ "@aws-sdk/client-sts": "^3.624.0"
89
89
  },
90
90
  "browser": {
91
91
  "./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
@@ -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.623.0",
4
+ "version": "3.624.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,9 +22,9 @@
22
22
  "dependencies": {
23
23
  "@aws-crypto/sha256-browser": "5.2.0",
24
24
  "@aws-crypto/sha256-js": "5.2.0",
25
- "@aws-sdk/client-sso-oidc": "3.623.0",
26
- "@aws-sdk/core": "3.623.0",
27
- "@aws-sdk/credential-provider-node": "3.623.0",
25
+ "@aws-sdk/client-sso-oidc": "3.624.0",
26
+ "@aws-sdk/core": "3.624.0",
27
+ "@aws-sdk/credential-provider-node": "3.624.0",
28
28
  "@aws-sdk/middleware-host-header": "3.620.0",
29
29
  "@aws-sdk/middleware-logger": "3.609.0",
30
30
  "@aws-sdk/middleware-recursion-detection": "3.620.0",
@@ -25,7 +25,8 @@ __export(httpAuthSchemes_exports, {
25
25
  AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner,
26
26
  AwsSdkSigV4Signer: () => AwsSdkSigV4Signer,
27
27
  resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config,
28
- resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config
28
+ resolveAwsSdkSigV4Config: () => resolveAwsSdkSigV4Config,
29
+ validateSigningProperties: () => validateSigningProperties
29
30
  });
30
31
  module.exports = __toCommonJS(httpAuthSchemes_exports);
31
32
 
@@ -87,10 +88,21 @@ var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties)
87
88
  }, "validateSigningProperties");
88
89
  var _AwsSdkSigV4Signer = class _AwsSdkSigV4Signer {
89
90
  async sign(httpRequest, identity, signingProperties) {
91
+ var _a;
90
92
  if (!import_protocol_http2.HttpRequest.isInstance(httpRequest)) {
91
93
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
92
94
  }
93
- const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties);
95
+ const validatedProps = await validateSigningProperties(signingProperties);
96
+ const { config, signer } = validatedProps;
97
+ let { signingRegion, signingName } = validatedProps;
98
+ const handlerExecutionContext = signingProperties.context;
99
+ if (((_a = handlerExecutionContext == null ? void 0 : handlerExecutionContext.authSchemes) == null ? void 0 : _a.length) ?? 0 > 1) {
100
+ const [first, second] = handlerExecutionContext.authSchemes;
101
+ if ((first == null ? void 0 : first.name) === "sigv4a" && (second == null ? void 0 : second.name) === "sigv4") {
102
+ signingRegion = (second == null ? void 0 : second.signingRegion) ?? signingRegion;
103
+ signingName = (second == null ? void 0 : second.signingName) ?? signingName;
104
+ }
105
+ }
94
106
  const signedRequest = await signer.sign(httpRequest, {
95
107
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
96
108
  signingRegion,
@@ -249,5 +261,6 @@ var resolveAWSSDKSigV4Config = resolveAwsSdkSigV4Config;
249
261
  AwsSdkSigV4ASigner,
250
262
  AwsSdkSigV4Signer,
251
263
  resolveAWSSDKSigV4Config,
252
- resolveAwsSdkSigV4Config
264
+ resolveAwsSdkSigV4Config,
265
+ validateSigningProperties
253
266
  });
@@ -28,7 +28,17 @@ export class AwsSdkSigV4Signer {
28
28
  if (!HttpRequest.isInstance(httpRequest)) {
29
29
  throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
30
30
  }
31
- const { config, signer, signingRegion, signingName } = await validateSigningProperties(signingProperties);
31
+ const validatedProps = await validateSigningProperties(signingProperties);
32
+ const { config, signer } = validatedProps;
33
+ let { signingRegion, signingName } = validatedProps;
34
+ const handlerExecutionContext = signingProperties.context;
35
+ if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
36
+ const [first, second] = handlerExecutionContext.authSchemes;
37
+ if (first?.name === "sigv4a" && second?.name === "sigv4") {
38
+ signingRegion = second?.signingRegion ?? signingRegion;
39
+ signingName = second?.signingName ?? signingName;
40
+ }
41
+ }
32
42
  const signedRequest = await signer.sign(httpRequest, {
33
43
  signingDate: getSkewCorrectedDate(config.systemClockOffset),
34
44
  signingRegion: signingRegion,
@@ -1,3 +1,3 @@
1
- export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer";
1
+ export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties } from "./AwsSdkSigV4Signer";
2
2
  export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
3
3
  export * from "./resolveAwsSdkSigV4Config";
@@ -1,3 +1,3 @@
1
- export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer";
1
+ export { AwsSdkSigV4Signer, AWSSDKSigV4Signer, validateSigningProperties } from "./AwsSdkSigV4Signer";
2
2
  export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
3
3
  export * from "./resolveAwsSdkSigV4Config";
@@ -1,3 +1,7 @@
1
- export { AwsSdkSigV4Signer, AWSSDKSigV4Signer } from "./AwsSdkSigV4Signer";
1
+ export {
2
+ AwsSdkSigV4Signer,
3
+ AWSSDKSigV4Signer,
4
+ validateSigningProperties,
5
+ } from "./AwsSdkSigV4Signer";
2
6
  export { AwsSdkSigV4ASigner } from "./AwsSdkSigV4ASigner";
3
7
  export * from "./resolveAwsSdkSigV4Config";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/core",
3
- "version": "3.623.0",
3
+ "version": "3.624.0",
4
4
  "description": "Core functions & classes shared by multiple AWS SDK clients",
5
5
  "scripts": {
6
6
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-ini",
3
- "version": "3.623.0",
3
+ "version": "3.624.0",
4
4
  "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,7 +27,7 @@
27
27
  "@aws-sdk/credential-provider-env": "3.620.1",
28
28
  "@aws-sdk/credential-provider-http": "3.622.0",
29
29
  "@aws-sdk/credential-provider-process": "3.620.1",
30
- "@aws-sdk/credential-provider-sso": "3.623.0",
30
+ "@aws-sdk/credential-provider-sso": "3.624.0",
31
31
  "@aws-sdk/credential-provider-web-identity": "3.621.0",
32
32
  "@aws-sdk/types": "3.609.0",
33
33
  "@smithy/credential-provider-imds": "^3.2.0",
@@ -45,7 +45,7 @@
45
45
  "typescript": "~4.9.5"
46
46
  },
47
47
  "peerDependencies": {
48
- "@aws-sdk/client-sts": "^3.623.0"
48
+ "@aws-sdk/client-sts": "^3.624.0"
49
49
  },
50
50
  "types": "./dist-types/index.d.ts",
51
51
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-node",
3
- "version": "3.623.0",
3
+ "version": "3.624.0",
4
4
  "description": "AWS credential provider that sources credentials from a Node.JS environment. ",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
@@ -30,9 +30,9 @@
30
30
  "dependencies": {
31
31
  "@aws-sdk/credential-provider-env": "3.620.1",
32
32
  "@aws-sdk/credential-provider-http": "3.622.0",
33
- "@aws-sdk/credential-provider-ini": "3.623.0",
33
+ "@aws-sdk/credential-provider-ini": "3.624.0",
34
34
  "@aws-sdk/credential-provider-process": "3.620.1",
35
- "@aws-sdk/credential-provider-sso": "3.623.0",
35
+ "@aws-sdk/credential-provider-sso": "3.624.0",
36
36
  "@aws-sdk/credential-provider-web-identity": "3.621.0",
37
37
  "@aws-sdk/types": "3.609.0",
38
38
  "@smithy/credential-provider-imds": "^3.2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/credential-provider-sso",
3
- "version": "3.623.0",
3
+ "version": "3.624.0",
4
4
  "description": "AWS credential provider that exchanges a resolved SSO login token file for temporary AWS credentials",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/client-sso": "3.623.0",
27
+ "@aws-sdk/client-sso": "3.624.0",
28
28
  "@aws-sdk/token-providers": "3.614.0",
29
29
  "@aws-sdk/types": "3.609.0",
30
30
  "@smithy/property-provider": "^3.1.3",
@@ -31,6 +31,7 @@ __export(src_exports, {
31
31
  getCheckContentLengthHeaderPlugin: () => getCheckContentLengthHeaderPlugin,
32
32
  getRegionRedirectMiddlewarePlugin: () => getRegionRedirectMiddlewarePlugin,
33
33
  getS3ExpiresMiddlewarePlugin: () => getS3ExpiresMiddlewarePlugin,
34
+ getS3ExpressHttpSigningPlugin: () => getS3ExpressHttpSigningPlugin,
34
35
  getS3ExpressPlugin: () => getS3ExpressPlugin,
35
36
  getThrow200ExceptionsPlugin: () => getThrow200ExceptionsPlugin,
36
37
  getValidateBucketNamePlugin: () => getValidateBucketNamePlugin,
@@ -41,6 +42,8 @@ __export(src_exports, {
41
42
  resolveS3Config: () => resolveS3Config,
42
43
  s3ExpiresMiddleware: () => s3ExpiresMiddleware,
43
44
  s3ExpiresMiddlewareOptions: () => s3ExpiresMiddlewareOptions,
45
+ s3ExpressHttpSigningMiddleware: () => s3ExpressHttpSigningMiddleware,
46
+ s3ExpressHttpSigningMiddlewareOptions: () => s3ExpressHttpSigningMiddlewareOptions,
44
47
  s3ExpressMiddleware: () => s3ExpressMiddleware,
45
48
  s3ExpressMiddlewareOptions: () => s3ExpressMiddlewareOptions,
46
49
  throw200ExceptionsMiddleware: () => throw200ExceptionsMiddleware,
@@ -89,20 +92,34 @@ var regionRedirectEndpointMiddleware = /* @__PURE__ */ __name((config) => {
89
92
  return (next, context) => async (args) => {
90
93
  const originalRegion = await config.region();
91
94
  const regionProviderRef = config.region;
95
+ let unlock = /* @__PURE__ */ __name(() => {
96
+ }, "unlock");
92
97
  if (context.__s3RegionRedirect) {
93
- config.region = async () => {
94
- config.region = regionProviderRef;
95
- return context.__s3RegionRedirect;
96
- };
98
+ Object.defineProperty(config, "region", {
99
+ writable: false,
100
+ value: async () => {
101
+ return context.__s3RegionRedirect;
102
+ }
103
+ });
104
+ unlock = /* @__PURE__ */ __name(() => Object.defineProperty(config, "region", {
105
+ writable: true,
106
+ value: regionProviderRef
107
+ }), "unlock");
97
108
  }
98
- const result = await next(args);
99
- if (context.__s3RegionRedirect) {
100
- const region = await config.region();
101
- if (originalRegion !== region) {
102
- throw new Error("Region was not restored following S3 region redirect.");
109
+ try {
110
+ const result = await next(args);
111
+ if (context.__s3RegionRedirect) {
112
+ unlock();
113
+ const region = await config.region();
114
+ if (originalRegion !== region) {
115
+ throw new Error("Region was not restored following S3 region redirect.");
116
+ }
103
117
  }
118
+ return result;
119
+ } catch (e) {
120
+ unlock();
121
+ throw e;
104
122
  }
105
- return result;
106
123
  };
107
124
  }, "regionRedirectEndpointMiddleware");
108
125
  var regionRedirectEndpointMiddlewareOptions = {
@@ -416,6 +433,68 @@ var getS3ExpressPlugin = /* @__PURE__ */ __name((options) => ({
416
433
  }
417
434
  }), "getS3ExpressPlugin");
418
435
 
436
+ // src/s3-express/functions/s3ExpressHttpSigningMiddleware.ts
437
+ var import_core = require("@smithy/core");
438
+
439
+ var import_util_middleware = require("@smithy/util-middleware");
440
+
441
+ // src/s3-express/functions/signS3Express.ts
442
+ var signS3Express = /* @__PURE__ */ __name(async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
443
+ const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
444
+ if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
445
+ throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
446
+ }
447
+ return signedRequest;
448
+ }, "signS3Express");
449
+
450
+ // src/s3-express/functions/s3ExpressHttpSigningMiddleware.ts
451
+ var defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error) => {
452
+ throw error;
453
+ }, "defaultErrorHandler");
454
+ var defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => {
455
+ }, "defaultSuccessHandler");
456
+ var s3ExpressHttpSigningMiddlewareOptions = import_core.httpSigningMiddlewareOptions;
457
+ var s3ExpressHttpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context) => async (args) => {
458
+ if (!import_protocol_http.HttpRequest.isInstance(args.request)) {
459
+ return next(args);
460
+ }
461
+ const smithyContext = (0, import_util_middleware.getSmithyContext)(context);
462
+ const scheme = smithyContext.selectedHttpAuthScheme;
463
+ if (!scheme) {
464
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
465
+ }
466
+ const {
467
+ httpAuthOption: { signingProperties = {} },
468
+ identity,
469
+ signer
470
+ } = scheme;
471
+ let request;
472
+ if (context.s3ExpressIdentity) {
473
+ request = await signS3Express(
474
+ context.s3ExpressIdentity,
475
+ signingProperties,
476
+ args.request,
477
+ await config.signer()
478
+ );
479
+ } else {
480
+ request = await signer.sign(args.request, identity, signingProperties);
481
+ }
482
+ const output = await next({
483
+ ...args,
484
+ request
485
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
486
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
487
+ return output;
488
+ }, "s3ExpressHttpSigningMiddleware");
489
+ var getS3ExpressHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
490
+ applyToStack: (clientStack) => {
491
+ clientStack.addRelativeTo(
492
+ s3ExpressHttpSigningMiddleware(config),
493
+ import_core.httpSigningMiddlewareOptions
494
+ );
495
+ }
496
+ }), "getS3ExpressHttpSigningPlugin");
497
+
419
498
  // src/s3Configuration.ts
420
499
  var resolveS3Config = /* @__PURE__ */ __name((input, {
421
500
  session
@@ -589,6 +668,9 @@ var getValidateBucketNamePlugin = /* @__PURE__ */ __name((options) => ({
589
668
  getS3ExpressPlugin,
590
669
  s3ExpressMiddleware,
591
670
  s3ExpressMiddlewareOptions,
671
+ getS3ExpressHttpSigningPlugin,
672
+ s3ExpressHttpSigningMiddleware,
673
+ s3ExpressHttpSigningMiddlewareOptions,
592
674
  resolveS3Config,
593
675
  throw200ExceptionsMiddleware,
594
676
  throw200ExceptionsMiddlewareOptions,
@@ -2,20 +2,34 @@ export const regionRedirectEndpointMiddleware = (config) => {
2
2
  return (next, context) => async (args) => {
3
3
  const originalRegion = await config.region();
4
4
  const regionProviderRef = config.region;
5
+ let unlock = () => { };
5
6
  if (context.__s3RegionRedirect) {
6
- config.region = async () => {
7
- config.region = regionProviderRef;
8
- return context.__s3RegionRedirect;
9
- };
7
+ Object.defineProperty(config, "region", {
8
+ writable: false,
9
+ value: async () => {
10
+ return context.__s3RegionRedirect;
11
+ },
12
+ });
13
+ unlock = () => Object.defineProperty(config, "region", {
14
+ writable: true,
15
+ value: regionProviderRef,
16
+ });
10
17
  }
11
- const result = await next(args);
12
- if (context.__s3RegionRedirect) {
13
- const region = await config.region();
14
- if (originalRegion !== region) {
15
- throw new Error("Region was not restored following S3 region redirect.");
18
+ try {
19
+ const result = await next(args);
20
+ if (context.__s3RegionRedirect) {
21
+ unlock();
22
+ const region = await config.region();
23
+ if (originalRegion !== region) {
24
+ throw new Error("Region was not restored following S3 region redirect.");
25
+ }
16
26
  }
27
+ return result;
28
+ }
29
+ catch (e) {
30
+ unlock();
31
+ throw e;
17
32
  }
18
- return result;
19
33
  };
20
34
  };
21
35
  export const regionRedirectEndpointMiddlewareOptions = {
@@ -0,0 +1,39 @@
1
+ import { httpSigningMiddlewareOptions } from "@smithy/core";
2
+ import { HttpRequest } from "@smithy/protocol-http";
3
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
4
+ import { getSmithyContext } from "@smithy/util-middleware";
5
+ import { signS3Express } from "./signS3Express";
6
+ const defaultErrorHandler = (signingProperties) => (error) => {
7
+ throw error;
8
+ };
9
+ const defaultSuccessHandler = (httpResponse, signingProperties) => { };
10
+ export const s3ExpressHttpSigningMiddlewareOptions = httpSigningMiddlewareOptions;
11
+ export const s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
12
+ if (!HttpRequest.isInstance(args.request)) {
13
+ return next(args);
14
+ }
15
+ const smithyContext = getSmithyContext(context);
16
+ const scheme = smithyContext.selectedHttpAuthScheme;
17
+ if (!scheme) {
18
+ throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
19
+ }
20
+ const { httpAuthOption: { signingProperties = {} }, identity, signer, } = scheme;
21
+ let request;
22
+ if (context.s3ExpressIdentity) {
23
+ request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
24
+ }
25
+ else {
26
+ request = await signer.sign(args.request, identity, signingProperties);
27
+ }
28
+ const output = await next({
29
+ ...args,
30
+ request,
31
+ }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
32
+ (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
33
+ return output;
34
+ };
35
+ export const getS3ExpressHttpSigningPlugin = (config) => ({
36
+ applyToStack: (clientStack) => {
37
+ clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), httpSigningMiddlewareOptions);
38
+ },
39
+ });
@@ -0,0 +1,7 @@
1
+ export const signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
2
+ const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
3
+ if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
4
+ throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
5
+ }
6
+ return signedRequest;
7
+ };
@@ -4,3 +4,4 @@ export { S3ExpressIdentityProviderImpl } from "./classes/S3ExpressIdentityProvid
4
4
  export { SignatureV4S3Express } from "./classes/SignatureV4S3Express";
5
5
  export { NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS } from "./constants";
6
6
  export { getS3ExpressPlugin, s3ExpressMiddleware, s3ExpressMiddlewareOptions } from "./functions/s3ExpressMiddleware";
7
+ export { getS3ExpressHttpSigningPlugin, s3ExpressHttpSigningMiddleware, s3ExpressHttpSigningMiddlewareOptions, } from "./functions/s3ExpressHttpSigningMiddleware";
@@ -0,0 +1,27 @@
1
+ import { IHttpRequest } from "@smithy/protocol-http";
2
+ import { AuthScheme, AwsCredentialIdentity, FinalizeRequestMiddleware, Pluggable, RequestSigner } from "@smithy/types";
3
+ interface SigningProperties {
4
+ signingRegion: string;
5
+ signingDate: Date;
6
+ signingService: string;
7
+ }
8
+ interface PreviouslyResolved {
9
+ signer: (authScheme?: AuthScheme | undefined) => Promise<RequestSigner & {
10
+ signWithCredentials(req: IHttpRequest, identity: AwsCredentialIdentity, opts?: Partial<SigningProperties>): Promise<IHttpRequest>;
11
+ }>;
12
+ }
13
+ /**
14
+ * @internal
15
+ */
16
+ export declare const s3ExpressHttpSigningMiddlewareOptions: import("@smithy/types").FinalizeRequestHandlerOptions & import("@smithy/types").RelativeLocation & Omit<import("@smithy/types").HandlerOptions, "step">;
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare const s3ExpressHttpSigningMiddleware: <Input extends object, Output extends object>(config: PreviouslyResolved) => FinalizeRequestMiddleware<any, any>;
21
+ /**
22
+ * @internal
23
+ */
24
+ export declare const getS3ExpressHttpSigningPlugin: (config: {
25
+ signer: (authScheme?: AuthScheme | undefined) => Promise<RequestSigner>;
26
+ }) => Pluggable<any, any>;
27
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { AwsCredentialIdentity, HttpRequest as IHttpRequest } from "@smithy/types";
2
+ import { S3ExpressIdentity } from "../interfaces/S3ExpressIdentity";
3
+ export declare const signS3Express: (s3ExpressIdentity: S3ExpressIdentity, signingOptions: {
4
+ signingDate: Date;
5
+ signingRegion: string;
6
+ signingService: string;
7
+ }, request: IHttpRequest, sigV4MultiRegionSigner: {
8
+ signWithCredentials(req: IHttpRequest, identity: AwsCredentialIdentity, opts?: Partial<{
9
+ signingDate: Date;
10
+ signingRegion: string;
11
+ signingService: string;
12
+ }> | undefined): Promise<IHttpRequest>;
13
+ }) => Promise<IHttpRequest>;
@@ -4,5 +4,6 @@ export { S3ExpressIdentityProviderImpl } from "./classes/S3ExpressIdentityProvid
4
4
  export { SignatureV4S3Express } from "./classes/SignatureV4S3Express";
5
5
  export { NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS } from "./constants";
6
6
  export { getS3ExpressPlugin, s3ExpressMiddleware, s3ExpressMiddlewareOptions } from "./functions/s3ExpressMiddleware";
7
+ export { getS3ExpressHttpSigningPlugin, s3ExpressHttpSigningMiddleware, s3ExpressHttpSigningMiddlewareOptions, } from "./functions/s3ExpressHttpSigningMiddleware";
7
8
  export { S3ExpressIdentity } from "./interfaces/S3ExpressIdentity";
8
9
  export { S3ExpressIdentityProvider } from "./interfaces/S3ExpressIdentityProvider";
@@ -0,0 +1,40 @@
1
+ import { IHttpRequest } from "@smithy/protocol-http";
2
+ import {
3
+ AuthScheme,
4
+ AwsCredentialIdentity,
5
+ FinalizeRequestMiddleware,
6
+ Pluggable,
7
+ RequestSigner,
8
+ } from "@smithy/types";
9
+ interface SigningProperties {
10
+ signingRegion: string;
11
+ signingDate: Date;
12
+ signingService: string;
13
+ }
14
+ interface PreviouslyResolved {
15
+ signer: (authScheme?: AuthScheme | undefined) => Promise<
16
+ RequestSigner & {
17
+ signWithCredentials(
18
+ req: IHttpRequest,
19
+ identity: AwsCredentialIdentity,
20
+ opts?: Partial<SigningProperties>
21
+ ): Promise<IHttpRequest>;
22
+ }
23
+ >;
24
+ }
25
+ export declare const s3ExpressHttpSigningMiddlewareOptions: import("@smithy/types").FinalizeRequestHandlerOptions &
26
+ import("@smithy/types").RelativeLocation &
27
+ Pick<
28
+ import("@smithy/types").HandlerOptions,
29
+ Exclude<keyof import("@smithy/types").HandlerOptions, "step">
30
+ >;
31
+ export declare const s3ExpressHttpSigningMiddleware: <
32
+ Input extends object,
33
+ Output extends object
34
+ >(
35
+ config: PreviouslyResolved
36
+ ) => FinalizeRequestMiddleware<any, any>;
37
+ export declare const getS3ExpressHttpSigningPlugin: (config: {
38
+ signer: (authScheme?: AuthScheme | undefined) => Promise<RequestSigner>;
39
+ }) => Pluggable<any, any>;
40
+ export {};
@@ -0,0 +1,27 @@
1
+ import {
2
+ AwsCredentialIdentity,
3
+ HttpRequest as IHttpRequest,
4
+ } from "@smithy/types";
5
+ import { S3ExpressIdentity } from "../interfaces/S3ExpressIdentity";
6
+ export declare const signS3Express: (
7
+ s3ExpressIdentity: S3ExpressIdentity,
8
+ signingOptions: {
9
+ signingDate: Date;
10
+ signingRegion: string;
11
+ signingService: string;
12
+ },
13
+ request: IHttpRequest,
14
+ sigV4MultiRegionSigner: {
15
+ signWithCredentials(
16
+ req: IHttpRequest,
17
+ identity: AwsCredentialIdentity,
18
+ opts?:
19
+ | Partial<{
20
+ signingDate: Date;
21
+ signingRegion: string;
22
+ signingService: string;
23
+ }>
24
+ | undefined
25
+ ): Promise<IHttpRequest>;
26
+ }
27
+ ) => Promise<IHttpRequest>;