@aws-sdk/middleware-signing 3.188.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,28 @@
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
+
17
+ # [3.190.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.189.0...v3.190.0) (2022-10-17)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **endpoint:** e2e test fixes for endpoints 2.0 all services ([#4044](https://github.com/aws/aws-sdk-js-v3/issues/4044)) ([b53f5bd](https://github.com/aws/aws-sdk-js-v3/commit/b53f5bdd2bb4f0d1bab208ef2cd8f67d56291934))
23
+
24
+
25
+
26
+
27
+
6
28
  # [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13)
7
29
 
8
30
  **Note:** Version bump only for package @aws-sdk/middleware-signing
@@ -41,10 +41,13 @@ const resolveAwsAuthConfig = (input) => {
41
41
  }
42
42
  else {
43
43
  signer = async (authScheme) => {
44
- if (!authScheme) {
45
- throw new Error("Unexpected empty auth scheme config");
46
- }
47
- const signingRegion = authScheme.signingScope;
44
+ authScheme = Object.assign({}, {
45
+ name: "sigv4",
46
+ signingName: input.signingName || input.defaultSigningName,
47
+ signingRegion: await (0, util_middleware_1.normalizeProvider)(input.region)(),
48
+ properties: {},
49
+ }, authScheme);
50
+ const signingRegion = authScheme.signingRegion;
48
51
  const signingService = authScheme.signingName;
49
52
  input.signingRegion = input.signingRegion || signingRegion;
50
53
  input.signingName = input.signingName || signingService || input.serviceId;
@@ -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
- 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];
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) => {
@@ -38,10 +38,13 @@ export const resolveAwsAuthConfig = (input) => {
38
38
  }
39
39
  else {
40
40
  signer = async (authScheme) => {
41
- if (!authScheme) {
42
- throw new Error("Unexpected empty auth scheme config");
43
- }
44
- const signingRegion = authScheme.signingScope;
41
+ authScheme = Object.assign({}, {
42
+ name: "sigv4",
43
+ signingName: input.signingName || input.defaultSigningName,
44
+ signingRegion: await normalizeProvider(input.region)(),
45
+ properties: {},
46
+ }, authScheme);
47
+ const signingRegion = authScheme.signingRegion;
45
48
  const signingService = authScheme.signingName;
46
49
  input.signingRegion = input.signingRegion || signingRegion;
47
50
  input.signingName = input.signingName || signingService || input.serviceId;
@@ -4,13 +4,14 @@ import { getUpdatedSystemClockOffset } from "./utils/getUpdatedSystemClockOffset
4
4
  export const awsAuthMiddleware = (options) => (next, context) => async function (args) {
5
5
  if (!HttpRequest.isInstance(args.request))
6
6
  return next(args);
7
- const authScheme = (context.endpointV2)?.properties?.authSchemes?.[0];
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) => {
@@ -52,6 +52,7 @@ interface PreviouslyResolved {
52
52
  region: string | Provider<string>;
53
53
  regionInfoProvider?: RegionInfoProvider;
54
54
  signingName?: string;
55
+ defaultSigningName?: string;
55
56
  serviceId: string;
56
57
  sha256: HashConstructor;
57
58
  useFipsEndpoint: Provider<boolean>;
@@ -34,6 +34,7 @@ interface PreviouslyResolved {
34
34
  region: string | Provider<string>;
35
35
  regionInfoProvider?: RegionInfoProvider;
36
36
  signingName?: string;
37
+ defaultSigningName?: string;
37
38
  serviceId: string;
38
39
  sha256: HashConstructor;
39
40
  useFipsEndpoint: Provider<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-signing",
3
- "version": "3.188.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",
@@ -20,11 +20,11 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@aws-sdk/property-provider": "3.188.0",
24
- "@aws-sdk/protocol-http": "3.188.0",
25
- "@aws-sdk/signature-v4": "3.188.0",
26
- "@aws-sdk/types": "3.188.0",
27
- "@aws-sdk/util-middleware": "3.188.0",
23
+ "@aws-sdk/property-provider": "3.190.0",
24
+ "@aws-sdk/protocol-http": "3.190.0",
25
+ "@aws-sdk/signature-v4": "3.190.0",
26
+ "@aws-sdk/types": "3.190.0",
27
+ "@aws-sdk/util-middleware": "3.190.0",
28
28
  "tslib": "^2.3.1"
29
29
  },
30
30
  "engines": {