Compare commits

..

4 Commits

Author SHA1 Message Date
28944b1100 3.0.2 2020-02-10 20:36:02 +00:00
7ec04d6d3d fix(core): update 2020-02-10 20:36:01 +00:00
595d4d8894 3.0.1 2020-02-10 20:16:50 +00:00
04ed28f7d1 fix(core): update 2020-02-10 20:16:49 +00:00
7 changed files with 8 additions and 31 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartacme",
"version": "3.0.0",
"version": "3.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartacme",
"version": "3.0.0",
"version": "3.0.2",
"private": false,
"description": "acme with an easy yet powerful interface in TypeScript",
"main": "dist/index.js",

View File

@ -1,10 +0,0 @@
export type TCertStatus = 'existing' | 'nonexisting' | 'pending' | 'failed';
export interface IOldCert {
id: string;
domainName: string;
created: number;
privateKey: string;
publicKey: string;
csr: string;
}

View File

@ -1,11 +0,0 @@
import { ICert, TCertStatus } from './cert';
export interface ICertRemoteRequest {
secret: string;
domainName: string;
}
export interface ICertRemoteResponse {
status: TCertStatus;
certificate?: ICert;
}

View File

@ -1,3 +1 @@
export * from './accountdata';
export * from './cert';
export * from './certremote';

View File

@ -41,7 +41,7 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements plug
plugins.smarttime.getMilliSecondsFromUnits({
days: 10
});
return this.validUntil >= shouldBeValidAtLeastUntil;
return !(this.validUntil >= shouldBeValidAtLeastUntil);
}
public update(certDataArg: plugins.tsclass.network.ICert) {

View File

@ -3,9 +3,6 @@ import { Cert } from './smartacme.classes.cert';
import { CertManager } from './smartacme.classes.certmanager';
import { CertMatcher } from './smartacme.classes.certmatcher';
import * as interfaces from './interfaces';
import { request } from 'http';
/**
* the options for the class @see SmartAcme
*/
@ -117,14 +114,17 @@ export class SmartAcme {
const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName);
const shouldberenewed = retrievedCertificate.shouldBeRenewed();
const isStillValid = retrievedCertificate.isStillValid();
if (!retrievedCertificate && await this.certmanager.interestMap.checkInterest(certDomainName)) {
const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName);
const certificate = existingCertificateInterest.interestFullfilled;
return certificate;
} else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) {
return retrievedCertificate;
} else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed) {
await retrievedCertificate.delete();
} else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed()) {
// await retrievedCertificate.delete();
}
// lets make sure others get the same interest