@aws-sdk/middleware-signing 3.713.0 → 3.723.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/dist-cjs/index.js +10 -14
- package/dist-es/awsAuthConfiguration.js +1 -0
- 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 =
|
|
80
|
+
const isSigv4a = authScheme?.name === "sigv4a";
|
|
81
81
|
const signingRegion = authScheme.signingRegion;
|
|
82
82
|
const signingService = authScheme.signingName;
|
|
83
83
|
let regionForSigner;
|
|
@@ -151,7 +151,8 @@ var createConfigBoundCredentialProvider = /* @__PURE__ */ __name((input) => {
|
|
|
151
151
|
);
|
|
152
152
|
const normalizedCreds = /* @__PURE__ */ __name(async () => normalizedCredentialsProvider({
|
|
153
153
|
callerClientConfig: {
|
|
154
|
-
region: (0, import_util_middleware.normalizeProvider)(input.region)
|
|
154
|
+
region: (0, import_util_middleware.normalizeProvider)(input.region),
|
|
155
|
+
profile: input.profile
|
|
155
156
|
}
|
|
156
157
|
}), "normalizedCreds");
|
|
157
158
|
return normalizedCreds;
|
|
@@ -177,21 +178,19 @@ var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSyst
|
|
|
177
178
|
|
|
178
179
|
// src/awsAuthMiddleware.ts
|
|
179
180
|
var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async function(args) {
|
|
180
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
181
181
|
if (!import_protocol_http.HttpRequest.isInstance(args.request))
|
|
182
182
|
return next(args);
|
|
183
183
|
let authScheme;
|
|
184
184
|
let signer;
|
|
185
|
-
const firstAuthScheme =
|
|
186
|
-
const secondAuthScheme =
|
|
187
|
-
const firstAuthSchemeIsSigv4a =
|
|
185
|
+
const firstAuthScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
186
|
+
const secondAuthScheme = context.endpointV2?.properties?.authSchemes?.[1];
|
|
187
|
+
const firstAuthSchemeIsSigv4a = firstAuthScheme?.name === "sigv4a";
|
|
188
188
|
if (firstAuthSchemeIsSigv4a && secondAuthScheme) {
|
|
189
189
|
signer = await options.signer(authScheme = firstAuthScheme);
|
|
190
190
|
const uncheckedSigner = signer;
|
|
191
191
|
const sigv4aAvailable = (() => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
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") {
|
|
195
194
|
return false;
|
|
196
195
|
}
|
|
197
196
|
try {
|
|
@@ -209,7 +208,7 @@ var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => a
|
|
|
209
208
|
signer = await options.signer(authScheme = firstAuthScheme);
|
|
210
209
|
}
|
|
211
210
|
let signedRequest;
|
|
212
|
-
const multiRegionOverride =
|
|
211
|
+
const multiRegionOverride = authScheme?.name === "sigv4a" ? authScheme?.signingRegionSet?.join(",") : void 0;
|
|
213
212
|
const signingOptions = {
|
|
214
213
|
signingDate: getSkewCorrectedDate(options.systemClockOffset),
|
|
215
214
|
signingRegion: multiRegionOverride || context["signing_region"],
|
|
@@ -244,10 +243,7 @@ var awsAuthMiddleware = /* @__PURE__ */ __name((options) => (next, context) => a
|
|
|
244
243
|
}
|
|
245
244
|
return output;
|
|
246
245
|
}, "awsAuthMiddleware");
|
|
247
|
-
var getDateHeader = /* @__PURE__ */ __name((response) =>
|
|
248
|
-
var _a, _b;
|
|
249
|
-
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;
|
|
250
|
-
}, "getDateHeader");
|
|
246
|
+
var getDateHeader = /* @__PURE__ */ __name((response) => import_protocol_http.HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
|
|
251
247
|
var awsAuthMiddlewareOptions = {
|
|
252
248
|
name: "awsAuthMiddleware",
|
|
253
249
|
tags: ["SIGNATURE", "AWSAUTH"],
|
|
@@ -114,6 +114,7 @@ const createConfigBoundCredentialProvider = (input) => {
|
|
|
114
114
|
const normalizedCreds = async () => normalizedCredentialsProvider({
|
|
115
115
|
callerClientConfig: {
|
|
116
116
|
region: normalizeProvider(input.region),
|
|
117
|
+
profile: input.profile,
|
|
117
118
|
},
|
|
118
119
|
});
|
|
119
120
|
return normalizedCreds;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-signing",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.723.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.
|
|
28
|
-
"@smithy/property-provider": "^
|
|
29
|
-
"@smithy/protocol-http": "^
|
|
30
|
-
"@smithy/signature-v4": "^
|
|
31
|
-
"@smithy/types": "^
|
|
32
|
-
"@smithy/util-middleware": "^
|
|
27
|
+
"@aws-sdk/types": "3.723.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": ">=
|
|
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": "~
|
|
59
|
+
"typescript": "~5.2.2"
|
|
60
60
|
}
|
|
61
61
|
}
|