@aws-sdk/cloudfront-signer 3.1063.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 +4 -6
- package/package.json +5 -5
package/dist-cjs/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var protocols = require('@smithy/core/protocols');
|
|
4
|
-
var node_crypto = require('node:crypto');
|
|
1
|
+
const { extendedEncodeURIComponent } = require("@smithy/core/protocols");
|
|
2
|
+
const { createSign } = require("node:crypto");
|
|
5
3
|
|
|
6
4
|
function getSignedUrl({ dateLessThan, dateGreaterThan, url, keyPairId, privateKey, ipAddress, policy, passphrase, algorithm, }) {
|
|
7
5
|
const cloudfrontSignBuilder = new CloudfrontSignBuilder({
|
|
@@ -42,7 +40,7 @@ function getSignedUrl({ dateLessThan, dateGreaterThan, url, keyPairId, privateKe
|
|
|
42
40
|
}
|
|
43
41
|
const params = Object.entries(attributes)
|
|
44
42
|
.filter(([, value]) => value !== undefined)
|
|
45
|
-
.map(([key, value]) => `${
|
|
43
|
+
.map(([key, value]) => `${extendedEncodeURIComponent(key)}=${extendedEncodeURIComponent(value)}`)
|
|
46
44
|
.join("&");
|
|
47
45
|
const urlString = baseUrl + startFlag + params;
|
|
48
46
|
return getResource(urlString);
|
|
@@ -251,7 +249,7 @@ class CloudfrontSignBuilder {
|
|
|
251
249
|
};
|
|
252
250
|
}
|
|
253
251
|
signData(data, privateKey, passphrase) {
|
|
254
|
-
const sign =
|
|
252
|
+
const sign = createSign(this.algorithm === "SHA256" ? "RSA-SHA256" : "RSA-SHA1");
|
|
255
253
|
sign.update(data);
|
|
256
254
|
return sign.sign({ key: privateKey, passphrase }, "base64");
|
|
257
255
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/cloudfront-signer",
|
|
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
|
-
"build:cjs": "node ../../scripts/compilation/inline
|
|
7
|
-
"build:es": "tsc -p tsconfig.es.json",
|
|
6
|
+
"build:cjs": "node ../../scripts/compilation/inline",
|
|
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",
|