Compare commits

...

12 Commits

Author SHA1 Message Date
7277906851 3.0.6 2020-05-17 16:21:26 +00:00
9da9ebb01e fix(core): update 2020-05-17 16:21:25 +00:00
f70684b773 3.0.5 2020-02-21 10:48:09 +00:00
8b19b206a4 fix(core): update 2020-02-21 10:48:08 +00:00
6be2866ddd 3.0.4 2020-02-19 19:17:59 +00:00
ab55d3c91a fix(core): update 2020-02-19 19:17:58 +00:00
c7ee7eb774 3.0.3 2020-02-19 18:48:50 +00:00
02daa13a2f fix(core): update 2020-02-19 18:48:49 +00:00
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
14 changed files with 119 additions and 125 deletions

4
.gitignore vendored
View File

@ -15,8 +15,6 @@ node_modules/
# builds # builds
dist/ dist/
dist_web/ dist_*/
dist_serve/
dist_ts_web/
# custom # custom

View File

@ -24,13 +24,14 @@ mirror:
- docker - docker
- notpriv - notpriv
snyk: audit:
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command snyk test - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high
tags: tags:
- lossless - lossless
- docker - docker

View File

@ -1,36 +0,0 @@
# @pushrocks/smartuniverse
acme with an easy yet powerful interface in TypeScript
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/)
## Status for master
[![build status](https://gitlab.com/pushrocks/smartuniverse/badges/master/build.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartuniverse/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartuniverse.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartuniverse/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartuniverse)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
import { SmartAcme } from 'smartacme';
let smac = new SmartAcme()
// TODO
```
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

63
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartacme", "name": "@pushrocks/smartacme",
"version": "3.0.0", "version": "3.0.6",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -109,9 +109,9 @@
} }
}, },
"@pushrocks/lik": { "@pushrocks/lik": {
"version": "3.0.17", "version": "3.0.19",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.17.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.19.tgz",
"integrity": "sha512-Ip56GDuW/ReBPhRVIhaqosqXu12SBW1DT3GkY8hOTiF1YNdKxiaw13QOPva6KPeTffb9DTThOu352KvjMrfxRw==", "integrity": "sha512-N9uTtQmTJ/iZ/V7LMCKbVx/ZAmP+b8uId0pxV9Au9T0Ulu9wcg3vNpyTQARgdWfG+tI9Qc0NHgOEa9H5mbDcDA==",
"requires": { "requires": {
"@pushrocks/smartdelay": "^2.0.6", "@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.0.6",
@ -157,19 +157,19 @@
} }
}, },
"@pushrocks/smartdata": { "@pushrocks/smartdata": {
"version": "3.1.25", "version": "3.1.26",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdata/-/smartdata-3.1.25.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdata/-/smartdata-3.1.26.tgz",
"integrity": "sha512-omgb42HnDaaZKkhbVRx9Zfxumkg7lVyp526eA93eQaoNHZGPkIPo7H9f4+rWHbN3VZehB/PTmPGcY5IUd5rWUA==", "integrity": "sha512-nfHBjkjdZU6R5MlkzilR3pdY52kRiNoqp96JPV53xFfVUptP5F6JppPw9Zmnbu2EM5vYfCimSGawms1Xeb9jRQ==",
"requires": { "requires": {
"@pushrocks/lik": "^3.0.17", "@pushrocks/lik": "^3.0.19",
"@pushrocks/smartlog": "^2.0.21", "@pushrocks/smartlog": "^2.0.21",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartstring": "^3.0.18", "@pushrocks/smartstring": "^3.0.18",
"@pushrocks/smartunique": "^3.0.1", "@pushrocks/smartunique": "^3.0.1",
"@types/lodash": "^4.14.149", "@types/lodash": "^4.14.149",
"@types/mongodb": "^3.3.15", "@types/mongodb": "^3.3.16",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"mongodb": "^3.5.2", "mongodb": "^3.5.3",
"runtime-type-checks": "0.0.4" "runtime-type-checks": "0.0.4"
} }
}, },
@ -182,19 +182,14 @@
} }
}, },
"@pushrocks/smartdns": { "@pushrocks/smartdns": {
"version": "3.0.8", "version": "4.0.2",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdns/-/smartdns-3.0.8.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdns/-/smartdns-4.0.2.tgz",
"integrity": "sha512-f6cyO3FOnUJQTjHUjcePP6xMDytjk4DrmRDpqooQtMipTf8t0R25Yvg7GooSdWiBJDrIXHrXVu+oq82L5mFuUQ==", "integrity": "sha512-4PZUsv8VpEGuUkfnXolzZH9KrRlvBYXNnmK3bvoyP3cgC4Ocad/Pk9eE5JxVIB0t8ehljmYyOrP1McHmXOma4A==",
"requires": { "requires": {
"@pushrocks/smartdelay": "^2.0.2", "@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartpromise": "^2.0.5" "@pushrocks/smartpromise": "^3.0.6",
}, "@pushrocks/smartrequest": "^1.1.47",
"dependencies": { "@tsclass/tsclass": "^3.0.6"
"@pushrocks/smartpromise": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
}
} }
}, },
"@pushrocks/smartevent": { "@pushrocks/smartevent": {
@ -536,9 +531,9 @@
} }
}, },
"@tsclass/tsclass": { "@tsclass/tsclass": {
"version": "3.0.4", "version": "3.0.7",
"resolved": "https://verdaccio.lossless.one/@tsclass%2ftsclass/-/tsclass-3.0.4.tgz", "resolved": "https://verdaccio.lossless.one/@tsclass%2ftsclass/-/tsclass-3.0.7.tgz",
"integrity": "sha512-q9PnwBFDTTlwKp6jYn/tL6zhqWvwaKyGsf81xI8xcV6IhjmFo3hk0iM4L3ydw7iTwqR+WmhYaWO5WdMy3/KA+w==", "integrity": "sha512-3s3pU0xrQsMpsvxby0eUgz6z3DpJTaRghLpoFSJ+uJMzi7n0QhwuEiydLbp1CgVvDnIByvQcN8LvU9q3tOswSA==",
"requires": { "requires": {
"@pushrocks/tapbundle": "^3.0.13" "@pushrocks/tapbundle": "^3.0.13"
} }
@ -684,18 +679,18 @@
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
}, },
"@types/mongodb": { "@types/mongodb": {
"version": "3.3.15", "version": "3.3.16",
"resolved": "https://verdaccio.lossless.one/@types%2fmongodb/-/mongodb-3.3.15.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fmongodb/-/mongodb-3.3.16.tgz",
"integrity": "sha512-q2dL0VEdFdE9iS0xrTP0NSgJJBFH4hBvt3beglCwU3qMWrz7dCuu/CrRjPB4+R8jLjCi/Gik2Mkd+lU0sYsZgQ==", "integrity": "sha512-i1Ov36BXdp+urtPsaSvrNfCdsaVn4Ukq1m1kGyzdWB1+eg3gJ68unXU5LNmnF4EAMRFY6FXZzA7/W3NST40b8g==",
"requires": { "requires": {
"@types/bson": "*", "@types/bson": "*",
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/node": { "@types/node": {
"version": "13.7.0", "version": "13.7.4",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.0.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.4.tgz",
"integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==" "integrity": "sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw=="
}, },
"@types/range-parser": { "@types/range-parser": {
"version": "1.2.3", "version": "1.2.3",
@ -2081,9 +2076,9 @@
} }
}, },
"mongodb": { "mongodb": {
"version": "3.5.2", "version": "3.5.3",
"resolved": "https://verdaccio.lossless.one/mongodb/-/mongodb-3.5.2.tgz", "resolved": "https://verdaccio.lossless.one/mongodb/-/mongodb-3.5.3.tgz",
"integrity": "sha512-Lxt4th2tK2MxmkDBR5cMik+xEnkvhwg0BC5kGcHm9RBwaNEsrIryvV5istGXOHbnif5KslMpY1FbX6YbGJ/Trg==", "integrity": "sha512-II7P7A3XUdPiXRgcN96qIoRa1oesM6qLNZkzfPluNZjVkgQk3jnQwOT6/uDk4USRDTTLjNFw2vwfmbRGTA7msg==",
"requires": { "requires": {
"bl": "^2.2.0", "bl": "^2.2.0",
"bson": "^1.1.1", "bson": "^1.1.1",

View File

@ -1,10 +1,10 @@
{ {
"name": "@pushrocks/smartacme", "name": "@pushrocks/smartacme",
"version": "3.0.0", "version": "3.0.6",
"private": false, "private": false,
"description": "acme with an easy yet powerful interface in TypeScript", "description": "acme with an easy yet powerful interface in TypeScript",
"main": "dist/index.js", "main": "dist_ts/index.js",
"typings": "dist/index.d.ts", "typings": "dist_ts/index.d.ts",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild)" "build": "(tsbuild)"
@ -25,10 +25,10 @@
}, },
"homepage": "https://gitlab.com/umbrellazone/smartacme#README", "homepage": "https://gitlab.com/umbrellazone/smartacme#README",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^3.0.17", "@pushrocks/lik": "^3.0.19",
"@pushrocks/smartdata": "^3.1.25", "@pushrocks/smartdata": "^3.1.26",
"@pushrocks/smartdelay": "^2.0.6", "@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartdns": "^3.0.8", "@pushrocks/smartdns": "^4.0.2",
"@pushrocks/smartexpress": "^3.0.57", "@pushrocks/smartexpress": "^3.0.57",
"@pushrocks/smartlog": "^2.0.21", "@pushrocks/smartlog": "^2.0.21",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.0.6",
@ -36,7 +36,7 @@
"@pushrocks/smartstring": "^3.0.18", "@pushrocks/smartstring": "^3.0.18",
"@pushrocks/smarttime": "^3.0.12", "@pushrocks/smarttime": "^3.0.12",
"@pushrocks/smartunique": "^3.0.1", "@pushrocks/smartunique": "^3.0.1",
"@tsclass/tsclass": "^3.0.4", "@tsclass/tsclass": "^3.0.7",
"acme-client": "^3.3.1" "acme-client": "^3.3.1"
}, },
"devDependencies": { "devDependencies": {
@ -46,7 +46,7 @@
"@mojoio/cloudflare": "^4.0.3", "@mojoio/cloudflare": "^4.0.3",
"@pushrocks/qenv": "^4.0.6", "@pushrocks/qenv": "^4.0.6",
"@pushrocks/tapbundle": "^3.2.0", "@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.7.0", "@types/node": "^13.7.4",
"tslint": "^6.0.0", "tslint": "^6.0.0",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
@ -54,7 +54,8 @@
"ts/**/*", "ts/**/*",
"ts_web/**/*", "ts_web/**/*",
"dist/**/*", "dist/**/*",
"dist_web/**/*", "dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*", "dist_ts_web/**/*",
"assets/**/*", "assets/**/*",
"cli.js", "cli.js",

59
readme.md Normal file
View File

@ -0,0 +1,59 @@
# @pushrocks/smartuniverse
acme with an easy yet powerful interface in TypeScript
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/)
## Status for master
[![pipeline status](https://gitlab.com/pushrocks/smartuniverse/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartuniverse/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartuniverse.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartuniverse/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartuniverse)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
import { SmartAcme } from 'smartacme';
const run = async () => {
smartAcmeInstance = new smartacme.SmartAcme({
accountEmail: 'domains@lossless.org',
accountPrivateKey: null,
mongoDescriptor: {
mongoDbName: testQenv.getEnvVarRequired('MONGODB_DATABASE'),
mongoDbPass: testQenv.getEnvVarRequired('MONGODB_PASSWORD'),
mongoDbUrl: testQenv.getEnvVarRequired('MONGODB_URL')
},
removeChallenge: async dnsChallenge => {
// somehow provide a function that is able to remove the dns challenge
},
setChallenge: async dnsChallenge => {
// somehow provide a function that is able to the dns challenge
},
environment: 'integration'
});
await smartAcmeInstance.init();
// myCert has properties for public/private keys and csr ;)
const myCert = await smartAcmeInstance.getCertificateForDomain('bleu.de');
};
```
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

View File

@ -21,10 +21,10 @@ tap.test('should create a valid instance of SmartAcme', async () => {
mongoDbPass: testQenv.getEnvVarRequired('MONGODB_PASSWORD'), mongoDbPass: testQenv.getEnvVarRequired('MONGODB_PASSWORD'),
mongoDbUrl: testQenv.getEnvVarRequired('MONGODB_URL') mongoDbUrl: testQenv.getEnvVarRequired('MONGODB_URL')
}, },
removeChallenge: async (dnsChallenge) => { removeChallenge: async dnsChallenge => {
testCloudflare.convenience.acmeRemoveDnsChallenge(dnsChallenge); testCloudflare.convenience.acmeRemoveDnsChallenge(dnsChallenge);
}, },
setChallenge: async (dnsChallenge) => { setChallenge: async dnsChallenge => {
testCloudflare.convenience.acmeSetDnsChallenge(dnsChallenge); testCloudflare.convenience.acmeSetDnsChallenge(dnsChallenge);
}, },
environment: 'integration' environment: 'integration'

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 './accountdata';
export * from './cert';
export * from './certremote';

View File

@ -9,7 +9,8 @@ import { Collection, svDb, unI } from '@pushrocks/smartdata';
@plugins.smartdata.Collection(() => { @plugins.smartdata.Collection(() => {
return CertManager.activeDB; return CertManager.activeDB;
}) })
export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements plugins.tsclass.network.ICert { export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert, plugins.tsclass.network.ICert>
implements plugins.tsclass.network.ICert {
@unI() @unI()
public id: string; public id: string;
@ -41,7 +42,7 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements plug
plugins.smarttime.getMilliSecondsFromUnits({ plugins.smarttime.getMilliSecondsFromUnits({
days: 10 days: 10
}); });
return this.validUntil >= shouldBeValidAtLeastUntil; return !(this.validUntil >= shouldBeValidAtLeastUntil);
} }
public update(certDataArg: plugins.tsclass.network.ICert) { public update(certDataArg: plugins.tsclass.network.ICert) {
@ -50,7 +51,6 @@ export class Cert extends plugins.smartdata.SmartDataDbDoc<Cert> implements plug
}); });
} }
constructor(optionsArg: plugins.tsclass.network.ICert) { constructor(optionsArg: plugins.tsclass.network.ICert) {
super(); super();
if (optionsArg) { if (optionsArg) {

View File

@ -34,7 +34,7 @@ export class CertManager {
CertManager.activeDB = this.smartdataDb; CertManager.activeDB = this.smartdataDb;
// Pending Map // Pending Map
this.interestMap = new plugins.lik.InterestMap((certName) => certName); this.interestMap = new plugins.lik.InterestMap(certName => certName);
} }
/** /**

View File

@ -3,9 +3,6 @@ import { Cert } from './smartacme.classes.cert';
import { CertManager } from './smartacme.classes.certmanager'; import { CertManager } from './smartacme.classes.certmanager';
import { CertMatcher } from './smartacme.classes.certmatcher'; import { CertMatcher } from './smartacme.classes.certmatcher';
import * as interfaces from './interfaces';
import { request } from 'http';
/** /**
* the options for the class @see SmartAcme * the options for the class @see SmartAcme
*/ */
@ -34,7 +31,7 @@ export class SmartAcme {
// the acme client // the acme client
private client: any; private client: any;
private smartdns = new plugins.smartdns.Smartdns(); private smartdns = new plugins.smartdns.Smartdns({});
public logger: plugins.smartlog.Smartlog; public logger: plugins.smartlog.Smartlog;
// the account private key // the account private key
@ -117,19 +114,21 @@ export class SmartAcme {
const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg); const certDomainName = this.certmatcher.getCertificateDomainNameByDomainName(domainArg);
const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName); const retrievedCertificate = await this.certmanager.retrieveCertificate(certDomainName);
if (!retrievedCertificate && await this.certmanager.interestMap.checkInterest(certDomainName)) { if (
!retrievedCertificate &&
(await this.certmanager.interestMap.checkInterest(certDomainName))
) {
const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName); const existingCertificateInterest = this.certmanager.interestMap.findInterest(certDomainName);
const certificate = existingCertificateInterest.interestFullfilled; const certificate = existingCertificateInterest.interestFullfilled;
return certificate; return certificate;
} else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) { } else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) {
return retrievedCertificate; return retrievedCertificate;
} else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed) { } else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed()) {
await retrievedCertificate.delete(); await retrievedCertificate.delete();
} }
// lets make sure others get the same interest // lets make sure others get the same interest
await this.certmanager.interestMap.addInterest(certDomainName); const currentDomainInterst = await this.certmanager.interestMap.addInterest(certDomainName);
/* Place new order */ /* Place new order */
const order = await this.client.createOrder({ const order = await this.client.createOrder({
@ -208,6 +207,8 @@ export class SmartAcme {
}); });
const newCertificate = await this.certmanager.retrieveCertificate(certDomainName); const newCertificate = await this.certmanager.retrieveCertificate(certDomainName);
currentDomainInterst.fullfillInterest(newCertificate);
currentDomainInterst.destroy();
return newCertificate; return newCertificate;
} }
} }

View File

@ -28,9 +28,7 @@ export {
// @tsclass scope // @tsclass scope
import * as tsclass from '@tsclass/tsclass'; import * as tsclass from '@tsclass/tsclass';
export { export { tsclass };
tsclass
}
// third party scope // third party scope
import * as acme from 'acme-client'; import * as acme from 'acme-client';