@relaycorp/relaynet-core
Advanced tools
Comparing version 1.25.2 to 1.25.3
@@ -53,5 +53,4 @@ /// <reference types="node" /> | ||
protected abstract deserializePayload(payloadPlaintext: ArrayBuffer): Payload; | ||
private validateValidityPeriod; | ||
private validateAuthorization; | ||
protected validateAuthorization(trustedCertificates: readonly Certificate[]): Promise<void>; | ||
} | ||
export {}; |
@@ -54,3 +54,2 @@ "use strict"; | ||
async validate(trustedCertificates) { | ||
this.validateValidityPeriod(); | ||
if (trustedCertificates) { | ||
@@ -67,11 +66,2 @@ await this.validateAuthorization(trustedCertificates); | ||
} | ||
validateValidityPeriod() { | ||
const now = new Date(); | ||
if (now < this.date) { | ||
throw new InvalidMessageError_1.default('Message creation date should be in the past'); | ||
} | ||
if (this.expiryDate < now) { | ||
throw new InvalidMessageError_1.default('Message expiry date should be in the future'); | ||
} | ||
} | ||
async validateAuthorization(trustedCertificates) { | ||
@@ -78,0 +68,0 @@ // tslint:disable-next-line:no-let |
@@ -198,2 +198,3 @@ "use strict"; | ||
} | ||
// TODO: Consider moving this into `Message.validate()` to make timing validation optional | ||
function validateMessageTiming(messageFields, signatureVerification) { | ||
@@ -200,0 +201,0 @@ const currentDate = new Date(); |
@@ -53,5 +53,4 @@ /// <reference types="node" /> | ||
protected abstract deserializePayload(payloadPlaintext: ArrayBuffer): Payload; | ||
private validateValidityPeriod; | ||
private validateAuthorization; | ||
protected validateAuthorization(trustedCertificates: readonly Certificate[]): Promise<void>; | ||
} | ||
export {}; |
@@ -48,3 +48,2 @@ import bufferToArray from 'buffer-to-arraybuffer'; | ||
async validate(trustedCertificates) { | ||
this.validateValidityPeriod(); | ||
if (trustedCertificates) { | ||
@@ -61,11 +60,2 @@ await this.validateAuthorization(trustedCertificates); | ||
} | ||
validateValidityPeriod() { | ||
const now = new Date(); | ||
if (now < this.date) { | ||
throw new InvalidMessageError('Message creation date should be in the past'); | ||
} | ||
if (this.expiryDate < now) { | ||
throw new InvalidMessageError('Message expiry date should be in the future'); | ||
} | ||
} | ||
async validateAuthorization(trustedCertificates) { | ||
@@ -72,0 +62,0 @@ // tslint:disable-next-line:no-let |
@@ -184,2 +184,3 @@ import * as asn1js from 'asn1js'; | ||
} | ||
// TODO: Consider moving this into `Message.validate()` to make timing validation optional | ||
function validateMessageTiming(messageFields, signatureVerification) { | ||
@@ -186,0 +187,0 @@ const currentDate = new Date(); |
{ | ||
"name": "@relaycorp/relaynet-core", | ||
"version": "1.25.2", | ||
"version": "1.25.3", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "email": "no-reply@relaycorp.tech", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
336422
5033