@aws-sdk/middleware-signing 3.190.0 → 3.192.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/CHANGELOG.md CHANGED
@@ -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.192.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.191.0...v3.192.0) (2022-10-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **endpoint:** use sigv4a signing region override ([#4054](https://github.com/aws/aws-sdk-js-v3/issues/4054)) ([a24892f](https://github.com/aws/aws-sdk-js-v3/commit/a24892f1ffc5a321b8f8d43a94e0df19bfa0e15a))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.190.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.189.0...v3.190.0) (2022-10-17)
7
18
 
8
19
 
@@ -5,16 +5,17 @@ const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const getSkewCorrectedDate_1 = require("./utils/getSkewCorrectedDate");
6
6
  const getUpdatedSystemClockOffset_1 = require("./utils/getUpdatedSystemClockOffset");
7
7
  const awsAuthMiddleware = (options) => (next, context) => async function (args) {
8
- var _a, _b, _c;
8
+ var _a, _b, _c, _d;
9
9
  if (!protocol_http_1.HttpRequest.isInstance(args.request))
10
10
  return next(args);
11
11
  const authScheme = (_c = (_b = (_a = context.endpointV2) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.authSchemes) === null || _c === void 0 ? void 0 : _c[0];
12
+ const multiRegionOverride = (authScheme === null || authScheme === void 0 ? void 0 : authScheme.name) === "sigv4a" ? (_d = authScheme === null || authScheme === void 0 ? void 0 : authScheme.signingRegionSet) === null || _d === void 0 ? void 0 : _d[0] : undefined;
12
13
  const signer = await options.signer(authScheme);
13
14
  const output = await next({
14
15
  ...args,
15
16
  request: await signer.sign(args.request, {
16
17
  signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset),
17
- signingRegion: context["signing_region"],
18
+ signingRegion: multiRegionOverride || context["signing_region"],
18
19
  signingService: context["signing_service"],
19
20
  }),
20
21
  }).catch((error) => {
@@ -5,12 +5,13 @@ export const awsAuthMiddleware = (options) => (next, context) => async function
5
5
  if (!HttpRequest.isInstance(args.request))
6
6
  return next(args);
7
7
  const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
8
+ const multiRegionOverride = authScheme?.name === "sigv4a" ? authScheme?.signingRegionSet?.[0] : undefined;
8
9
  const signer = await options.signer(authScheme);
9
10
  const output = await next({
10
11
  ...args,
11
12
  request: await signer.sign(args.request, {
12
13
  signingDate: getSkewCorrectedDate(options.systemClockOffset),
13
- signingRegion: context["signing_region"],
14
+ signingRegion: multiRegionOverride || context["signing_region"],
14
15
  signingService: context["signing_service"],
15
16
  }),
16
17
  }).catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-signing",
3
- "version": "3.190.0",
3
+ "version": "3.192.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "tsc -p tsconfig.cjs.json",