@aws-sdk/s3-request-presigner 3.1067.0 → 3.1069.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 +8 -10
- package/package.json +8 -8
package/dist-cjs/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var protocols = require('@smithy/core/protocols');
|
|
6
|
-
var signatureV4MultiRegion = require('@aws-sdk/signature-v4-multi-region');
|
|
1
|
+
const { formatUrl } = require("@aws-sdk/core/util");
|
|
2
|
+
const { getEndpointFromInstructions } = require("@smithy/core/endpoints");
|
|
3
|
+
const { HttpRequest } = require("@smithy/core/protocols");
|
|
4
|
+
const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
|
|
7
5
|
|
|
8
6
|
const UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
|
|
9
7
|
const SHA256_HEADER = "X-Amz-Content-Sha256";
|
|
@@ -17,7 +15,7 @@ class S3RequestPresigner {
|
|
|
17
15
|
applyChecksum: options.applyChecksum || false,
|
|
18
16
|
...options,
|
|
19
17
|
};
|
|
20
|
-
this.signer = new
|
|
18
|
+
this.signer = new SignatureV4MultiRegion(resolvedOptions);
|
|
21
19
|
}
|
|
22
20
|
presign(requestToSign, { unsignableHeaders = new Set(), hoistableHeaders = new Set(), unhoistableHeaders = new Set(), ...options } = {}) {
|
|
23
21
|
this.prepareRequest(requestToSign, {
|
|
@@ -69,7 +67,7 @@ const getSignedUrl = async (client, command, options = {}) => {
|
|
|
69
67
|
let s3Presigner;
|
|
70
68
|
let region;
|
|
71
69
|
if (typeof client.config.endpointProvider === "function") {
|
|
72
|
-
const endpointV2 = await
|
|
70
|
+
const endpointV2 = await getEndpointFromInstructions(command.input, command.constructor, client.config);
|
|
73
71
|
const authScheme = endpointV2.properties?.authSchemes?.[0];
|
|
74
72
|
if (authScheme?.name === "sigv4a") {
|
|
75
73
|
region = authScheme?.signingRegionSet?.join(",");
|
|
@@ -88,7 +86,7 @@ const getSignedUrl = async (client, command, options = {}) => {
|
|
|
88
86
|
}
|
|
89
87
|
const presignInterceptMiddleware = (next, context) => async (args) => {
|
|
90
88
|
const { request } = args;
|
|
91
|
-
if (!
|
|
89
|
+
if (!HttpRequest.isInstance(request)) {
|
|
92
90
|
throw new Error("Request to be presigned is not an valid HTTP request.");
|
|
93
91
|
}
|
|
94
92
|
delete request.headers["amz-sdk-invocation-id"];
|
|
@@ -125,7 +123,7 @@ const getSignedUrl = async (client, command, options = {}) => {
|
|
|
125
123
|
const handler = command.resolveMiddleware(clientStack, client.config, {});
|
|
126
124
|
const { output } = await handler({ input: command.input });
|
|
127
125
|
const { presigned } = output;
|
|
128
|
-
return
|
|
126
|
+
return formatUrl(presigned);
|
|
129
127
|
};
|
|
130
128
|
|
|
131
129
|
exports.S3RequestPresigner = S3RequestPresigner;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/s3-request-presigner",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1069.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
7
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
7
|
+
"build:es": "premove dist-es && tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
9
|
-
"build:types": "tsc -p tsconfig.types.json",
|
|
9
|
+
"build:types": "premove dist-types && tsc -p tsconfig.types.json",
|
|
10
10
|
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
11
|
-
"clean": "premove dist-cjs dist-es dist-types
|
|
11
|
+
"clean": "premove dist-cjs dist-es dist-types",
|
|
12
12
|
"extract:docs": "api-extractor run --local",
|
|
13
13
|
"test": "yarn g:vitest run",
|
|
14
14
|
"test:watch": "yarn g:vitest watch"
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/core": "^3.974.
|
|
27
|
-
"@aws-sdk/signature-v4-multi-region": "^3.996.
|
|
28
|
-
"@aws-sdk/types": "^3.973.
|
|
26
|
+
"@aws-sdk/core": "^3.974.21",
|
|
27
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.35",
|
|
28
|
+
"@aws-sdk/types": "^3.973.13",
|
|
29
29
|
"@smithy/core": "^3.24.6",
|
|
30
30
|
"@smithy/types": "^4.14.3",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@aws-sdk/client-s3": "3.
|
|
34
|
+
"@aws-sdk/client-s3": "3.1069.0",
|
|
35
35
|
"@tsconfig/recommended": "1.0.1",
|
|
36
36
|
"@types/node": "^20.14.8",
|
|
37
37
|
"concurrently": "7.0.0",
|