fix(core): update

This commit is contained in:
2020-02-10 11:15:47 +00:00
parent ac515f5e80
commit 83afea95e6
11 changed files with 270 additions and 299 deletions

View File

@ -28,22 +28,24 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements inte
@svDb()
public csr: string;
/**
* computed value for when the certificate is still valid
*/
get validUntil (): number {
return this.created + plugins.smarttime.getMilliSecondsFromUnits({
days: 90
});
get validUntil(): number {
return (
this.created +
plugins.smarttime.getMilliSecondsFromUnits({
days: 90
})
);
}
get isStillValid (): boolean {
const shouldBeValitAtLeastUntil = Date.now() + plugins.smarttime.getMilliSecondsFromUnits({
days: 10
});
get isStillValid(): boolean {
const shouldBeValitAtLeastUntil =
Date.now() +
plugins.smarttime.getMilliSecondsFromUnits({
days: 10
});
return this.validUntil >= shouldBeValitAtLeastUntil;
}