@aws-sdk/middleware-signing 3.460.0 → 3.465.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.
|
@@ -11,13 +11,25 @@ const awsAuthMiddleware = (options) => (next, context) => async function (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
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.join(",") : undefined;
|
|
13
13
|
const signer = await options.signer(authScheme);
|
|
14
|
+
let signedRequest;
|
|
15
|
+
const signingOptions = {
|
|
16
|
+
signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset),
|
|
17
|
+
signingRegion: multiRegionOverride || context["signing_region"],
|
|
18
|
+
signingService: context["signing_service"],
|
|
19
|
+
};
|
|
20
|
+
if (context.s3ExpressIdentity) {
|
|
21
|
+
const sigV4MultiRegion = signer;
|
|
22
|
+
signedRequest = await sigV4MultiRegion.signWithCredentials(args.request, context.s3ExpressIdentity, signingOptions);
|
|
23
|
+
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
24
|
+
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
signedRequest = await signer.sign(args.request, signingOptions);
|
|
29
|
+
}
|
|
14
30
|
const output = await next({
|
|
15
31
|
...args,
|
|
16
|
-
request:
|
|
17
|
-
signingDate: (0, getSkewCorrectedDate_1.getSkewCorrectedDate)(options.systemClockOffset),
|
|
18
|
-
signingRegion: multiRegionOverride || context["signing_region"],
|
|
19
|
-
signingService: context["signing_service"],
|
|
20
|
-
}),
|
|
32
|
+
request: signedRequest,
|
|
21
33
|
}).catch((error) => {
|
|
22
34
|
var _a;
|
|
23
35
|
const serverTime = (_a = error.ServerTime) !== null && _a !== void 0 ? _a : getDateHeader(error.$response);
|
|
@@ -7,13 +7,25 @@ export const awsAuthMiddleware = (options) => (next, context) => async function
|
|
|
7
7
|
const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
|
|
8
8
|
const multiRegionOverride = authScheme?.name === "sigv4a" ? authScheme?.signingRegionSet?.join(",") : undefined;
|
|
9
9
|
const signer = await options.signer(authScheme);
|
|
10
|
+
let signedRequest;
|
|
11
|
+
const signingOptions = {
|
|
12
|
+
signingDate: getSkewCorrectedDate(options.systemClockOffset),
|
|
13
|
+
signingRegion: multiRegionOverride || context["signing_region"],
|
|
14
|
+
signingService: context["signing_service"],
|
|
15
|
+
};
|
|
16
|
+
if (context.s3ExpressIdentity) {
|
|
17
|
+
const sigV4MultiRegion = signer;
|
|
18
|
+
signedRequest = await sigV4MultiRegion.signWithCredentials(args.request, context.s3ExpressIdentity, signingOptions);
|
|
19
|
+
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
20
|
+
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
signedRequest = await signer.sign(args.request, signingOptions);
|
|
25
|
+
}
|
|
10
26
|
const output = await next({
|
|
11
27
|
...args,
|
|
12
|
-
request:
|
|
13
|
-
signingDate: getSkewCorrectedDate(options.systemClockOffset),
|
|
14
|
-
signingRegion: multiRegionOverride || context["signing_region"],
|
|
15
|
-
signingService: context["signing_service"],
|
|
16
|
-
}),
|
|
28
|
+
request: signedRequest,
|
|
17
29
|
}).catch((error) => {
|
|
18
30
|
const serverTime = error.ServerTime ?? getDateHeader(error.$response);
|
|
19
31
|
if (serverTime) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-signing",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.465.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",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@aws-sdk/types": "3.
|
|
25
|
+
"@aws-sdk/types": "3.465.0",
|
|
26
26
|
"@smithy/property-provider": "^2.0.0",
|
|
27
27
|
"@smithy/protocol-http": "^3.0.9",
|
|
28
28
|
"@smithy/signature-v4": "^2.0.0",
|
|
@@ -54,10 +54,6 @@
|
|
|
54
54
|
"concurrently": "7.0.0",
|
|
55
55
|
"downlevel-dts": "0.10.1",
|
|
56
56
|
"rimraf": "3.0.2",
|
|
57
|
-
"typedoc": "0.23.23",
|
|
58
57
|
"typescript": "~4.9.5"
|
|
59
|
-
},
|
|
60
|
-
"typedoc": {
|
|
61
|
-
"entryPoint": "src/index.ts"
|
|
62
58
|
}
|
|
63
59
|
}
|