@aws-sdk/middleware-signing 3.714.0 → 3.731.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +8 -13
  2. package/package.json +9 -9
package/dist-cjs/index.js CHANGED
@@ -77,7 +77,7 @@ var resolveAwsAuthConfig = /* @__PURE__ */ __name((input) => {
77
77
  },
78
78
  authScheme
79
79
  );
80
- const isSigv4a = (authScheme == null ? void 0 : authScheme.name) === "sigv4a";
80
+ const isSigv4a = authScheme?.name === "sigv4a";
81
81
  const signingRegion = authScheme.signingRegion;
82
82
  const signingService = authScheme.signingName;
83
83
  let regionForSigner;
@@ -178,21 +178,19 @@ var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSyst
178
178
 
179
179
  // src/awsAuthMiddleware.ts
180
180
  var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async function(args) {
181
- var _a, _b, _c, _d, _e, _f, _g;
182
181
  if (!import_protocol_http.HttpRequest.isInstance(args.request))
183
182
  return next(args);
184
183
  let authScheme;
185
184
  let signer;
186
- const firstAuthScheme = (_c = (_b = (_a = context.endpointV2) == null ? void 0 : _a.properties) == null ? void 0 : _b.authSchemes) == null ? void 0 : _c[0];
187
- const secondAuthScheme = (_f = (_e = (_d = context.endpointV2) == null ? void 0 : _d.properties) == null ? void 0 : _e.authSchemes) == null ? void 0 : _f[1];
188
- const firstAuthSchemeIsSigv4a = (firstAuthScheme == null ? void 0 : firstAuthScheme.name) === "sigv4a";
185
+ const firstAuthScheme = context.endpointV2?.properties?.authSchemes?.[0];
186
+ const secondAuthScheme = context.endpointV2?.properties?.authSchemes?.[1];
187
+ const firstAuthSchemeIsSigv4a = firstAuthScheme?.name === "sigv4a";
189
188
  if (firstAuthSchemeIsSigv4a && secondAuthScheme) {
190
189
  signer = await options.signer(authScheme = firstAuthScheme);
191
190
  const uncheckedSigner = signer;
192
191
  const sigv4aAvailable = (() => {
193
- var _a2;
194
- if (typeof (uncheckedSigner == null ? void 0 : uncheckedSigner.getSigv4aSigner) === "function") {
195
- if (((_a2 = uncheckedSigner == null ? void 0 : uncheckedSigner.signerOptions) == null ? void 0 : _a2.runtime) !== "node") {
192
+ if (typeof uncheckedSigner?.getSigv4aSigner === "function") {
193
+ if (uncheckedSigner?.signerOptions?.runtime !== "node") {
196
194
  return false;
197
195
  }
198
196
  try {
@@ -210,7 +208,7 @@ var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => a
210
208
  signer = await options.signer(authScheme = firstAuthScheme);
211
209
  }
212
210
  let signedRequest;
213
- const multiRegionOverride = (authScheme == null ? void 0 : authScheme.name) === "sigv4a" ? (_g = authScheme == null ? void 0 : authScheme.signingRegionSet) == null ? void 0 : _g.join(",") : void 0;
211
+ const multiRegionOverride = authScheme?.name === "sigv4a" ? authScheme?.signingRegionSet?.join(",") : void 0;
214
212
  const signingOptions = {
215
213
  signingDate: getSkewCorrectedDate(options.systemClockOffset),
216
214
  signingRegion: multiRegionOverride || context["signing_region"],
@@ -245,10 +243,7 @@ var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => a
245
243
  }
246
244
  return output;
247
245
  }, "awsAuthMiddleware");
248
- var getDateHeader = /* @__PURE__ */ __name((response) => {
249
- var _a, _b;
250
- return import_protocol_http.HttpResponse.isInstance(response) ? ((_a = response.headers) == null ? void 0 : _a.date) ?? ((_b = response.headers) == null ? void 0 : _b.Date) : void 0;
251
- }, "getDateHeader");
246
+ var getDateHeader = /* @__PURE__ */ __name((response) => import_protocol_http.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
252
247
  var awsAuthMiddlewareOptions = {
253
248
  name: "awsAuthMiddleware",
254
249
  tags: ["SIGNATURE", "AWSAUTH"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/middleware-signing",
3
- "version": "3.714.0",
3
+ "version": "3.731.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 middleware-signing",
@@ -24,16 +24,16 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@aws-sdk/types": "3.714.0",
28
- "@smithy/property-provider": "^3.1.11",
29
- "@smithy/protocol-http": "^4.1.8",
30
- "@smithy/signature-v4": "^4.2.4",
31
- "@smithy/types": "^3.7.2",
32
- "@smithy/util-middleware": "^3.0.11",
27
+ "@aws-sdk/types": "3.731.0",
28
+ "@smithy/property-provider": "^4.0.0",
29
+ "@smithy/protocol-http": "^5.0.0",
30
+ "@smithy/signature-v4": "^5.0.0",
31
+ "@smithy/types": "^4.0.0",
32
+ "@smithy/util-middleware": "^4.0.0",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "engines": {
36
- "node": ">=16.0.0"
36
+ "node": ">=18.0.0"
37
37
  },
38
38
  "typesVersions": {
39
39
  "<4.0": {
@@ -56,6 +56,6 @@
56
56
  "concurrently": "7.0.0",
57
57
  "downlevel-dts": "0.10.1",
58
58
  "rimraf": "3.0.2",
59
- "typescript": "~4.9.5"
59
+ "typescript": "~5.2.2"
60
60
  }
61
61
  }