@aws-sdk/cloudfront-signer 3.734.0 → 3.772.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 +6 -6
- package/dist-es/sign.js +3 -3
- package/dist-types/sign.d.ts +2 -2
- package/dist-types/ts3.4/sign.d.ts +2 -2
- package/package.json +1 -1
package/dist-cjs/index.js
CHANGED
|
@@ -19,12 +19,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
|
-
var
|
|
23
|
-
__export(
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
24
|
getSignedCookies: () => getSignedCookies,
|
|
25
25
|
getSignedUrl: () => getSignedUrl
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
29
|
// src/sign.ts
|
|
30
30
|
var import_crypto = require("crypto");
|
|
@@ -235,13 +235,13 @@ var CloudfrontSignBuilder = class {
|
|
|
235
235
|
if (!date) {
|
|
236
236
|
return void 0;
|
|
237
237
|
}
|
|
238
|
-
const parsedDate = Date
|
|
239
|
-
return isNaN(parsedDate) ? void 0 : this.epochTime(
|
|
238
|
+
const parsedDate = new Date(date);
|
|
239
|
+
return isNaN(parsedDate.getTime()) ? void 0 : this.epochTime(parsedDate);
|
|
240
240
|
}
|
|
241
241
|
parseDateWindow(expiration, start) {
|
|
242
242
|
const dateLessThan = this.parseDate(expiration);
|
|
243
243
|
if (!dateLessThan) {
|
|
244
|
-
throw new Error("dateLessThan is invalid. Ensure the date
|
|
244
|
+
throw new Error("dateLessThan is invalid. Ensure the date value is compatible with the Date constructor.");
|
|
245
245
|
}
|
|
246
246
|
return {
|
|
247
247
|
dateLessThan,
|
package/dist-es/sign.js
CHANGED
|
@@ -188,13 +188,13 @@ class CloudfrontSignBuilder {
|
|
|
188
188
|
if (!date) {
|
|
189
189
|
return undefined;
|
|
190
190
|
}
|
|
191
|
-
const parsedDate = Date
|
|
192
|
-
return isNaN(parsedDate) ? undefined : this.epochTime(
|
|
191
|
+
const parsedDate = new Date(date);
|
|
192
|
+
return isNaN(parsedDate.getTime()) ? undefined : this.epochTime(parsedDate);
|
|
193
193
|
}
|
|
194
194
|
parseDateWindow(expiration, start) {
|
|
195
195
|
const dateLessThan = this.parseDate(expiration);
|
|
196
196
|
if (!dateLessThan) {
|
|
197
|
-
throw new Error("dateLessThan is invalid. Ensure the date
|
|
197
|
+
throw new Error("dateLessThan is invalid. Ensure the date value is compatible with the Date constructor.");
|
|
198
198
|
}
|
|
199
199
|
return {
|
|
200
200
|
dateLessThan,
|
package/dist-types/sign.d.ts
CHANGED
|
@@ -23,9 +23,9 @@ export type CloudfrontSignInputWithParameters = CloudfrontSignerCredentials & {
|
|
|
23
23
|
/** The URL string to sign. */
|
|
24
24
|
url: string;
|
|
25
25
|
/** The date string for when the signed URL or cookie can no longer be accessed */
|
|
26
|
-
dateLessThan: string;
|
|
26
|
+
dateLessThan: string | number | Date;
|
|
27
27
|
/** The date string for when the signed URL or cookie can start to be accessed. */
|
|
28
|
-
dateGreaterThan?: string;
|
|
28
|
+
dateGreaterThan?: string | number | Date;
|
|
29
29
|
/** The IP address string to restrict signed URL access to. */
|
|
30
30
|
ipAddress?: string;
|
|
31
31
|
/**
|
|
@@ -8,8 +8,8 @@ export type CloudfrontSignerCredentials = {
|
|
|
8
8
|
};
|
|
9
9
|
export type CloudfrontSignInputWithParameters = CloudfrontSignerCredentials & {
|
|
10
10
|
url: string;
|
|
11
|
-
dateLessThan: string;
|
|
12
|
-
dateGreaterThan?: string;
|
|
11
|
+
dateLessThan: string | number | Date;
|
|
12
|
+
dateGreaterThan?: string | number | Date;
|
|
13
13
|
ipAddress?: string;
|
|
14
14
|
policy?: never;
|
|
15
15
|
};
|
package/package.json
CHANGED