update
This commit is contained in:
parent
7d16ada760
commit
84177cd575
44
README.md
44
README.md
@ -2,10 +2,10 @@
|
||||
acme implementation in TypeScript
|
||||
|
||||
## Availabililty
|
||||
[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartacme)
|
||||
[![git](https://push.rocks/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartacme)
|
||||
[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartacme)
|
||||
[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartacme/)
|
||||
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartacme)
|
||||
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartacme)
|
||||
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartacme)
|
||||
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartacme/)
|
||||
|
||||
## Status for master
|
||||
[![build status](https://GitLab.com/pushrocks/smartacme/badges/master/build.svg)](https://GitLab.com/pushrocks/smartacme/commits/master)
|
||||
@ -21,37 +21,9 @@ acme implementation in TypeScript
|
||||
## Usage
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
```javascript
|
||||
import { SmartAcme } from 'smartacme'
|
||||
For further information read the linked docs at the top of this README.
|
||||
|
||||
let smac = new SmartAcme()
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
(async () => { // learn async/await, it'll make your life easier
|
||||
|
||||
// optionally accepts a filePath Arg with a stored acmeaccount.json
|
||||
// will create an account and
|
||||
let myAccount = await smac.createAcmeAccount()
|
||||
|
||||
// will return a dnsHash to set in your DNS record
|
||||
let myCert = await myAccount.createAcmeCert('example.com')
|
||||
|
||||
// gets and accepts the specified challenge
|
||||
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
|
||||
let myChallenge = await myCert.getChallenge('dns-01')
|
||||
|
||||
/* ----------
|
||||
Now you need to set the challenge in your DNS
|
||||
myChallenge.domainNamePrefixed is the address for the record
|
||||
myChallenge.dnsKeyHash is the ready to use txt record value expected by letsencrypt
|
||||
-------------*/
|
||||
})()
|
||||
```
|
||||
|
||||
## Other relevant npm modules
|
||||
module name | description
|
||||
--- | ---
|
||||
cert | a higlevel production module that uses smartacme to manage certs
|
||||
smartnginx | a highlevel production tool for docker environments to manage nginx
|
||||
|
||||
|
||||
[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)
|
||||
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://git.zone)
|
||||
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -2,5 +2,6 @@
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("./smartacme.classes.smartacme"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsbURBQTZDIn0=
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLG1EQUE2QyJ9
|
8
dist/smartacme.classes.acmeaccount.d.ts
vendored
8
dist/smartacme.classes.acmeaccount.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { SmartAcme } from './smartacme.classes.smartacme';
|
||||
import { AcmeCert } from './smartacme.classes.acmecert';
|
||||
/**
|
||||
@ -14,10 +12,10 @@ export declare class AcmeAccount {
|
||||
/**
|
||||
* register the account with letsencrypt
|
||||
*/
|
||||
register(): q.Promise<{}>;
|
||||
register(): Promise<{}>;
|
||||
/**
|
||||
* agree to letsencrypr terms of service
|
||||
*/
|
||||
agreeTos(): q.Promise<{}>;
|
||||
createAcmeCert(domainNameArg: string, countryArg?: string, countryShortArg?: string, city?: string, companyArg?: string, companyShortArg?: string): q.Promise<AcmeCert>;
|
||||
agreeTos(): Promise<{}>;
|
||||
createAcmeCert(domainNameArg: string, countryArg?: string, countryShortArg?: string, city?: string, companyArg?: string, companyShortArg?: string): Promise<AcmeCert>;
|
||||
}
|
||||
|
5
dist/smartacme.classes.acmeaccount.js
vendored
5
dist/smartacme.classes.acmeaccount.js
vendored
@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
const q = require("q");
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const q = require("smartq");
|
||||
const smartacme_classes_acmecert_1 = require("./smartacme.classes.acmecert");
|
||||
/**
|
||||
* class AcmeAccount represents an AcmeAccount
|
||||
@ -68,4 +69,4 @@ class AcmeAccount {
|
||||
}
|
||||
}
|
||||
exports.AcmeAccount = AcmeAccount;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLmNsYXNzZXMuYWNtZWFjY291bnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUuY2xhc3Nlcy5hY21lYWNjb3VudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsdUJBQXNCO0FBTXRCLDZFQUF1RDtBQUV2RDs7R0FFRztBQUNIO0lBS0ksWUFBWSxrQkFBNkI7UUFDckMsSUFBSSxDQUFDLGVBQWUsR0FBRyxrQkFBa0IsQ0FBQTtJQ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UFHLEVBQUUsSUFBSTtZQUNULEdBQUcsRUFBRSxJQUFJO1lBQ1QsTUFBTSxFQUFFLGFBQWE7WUFDckIsT0FBTyxFQUFFLFVBQVU7WUFDbkIsYUFBYSxFQUFFLGVBQWU7WUFDOUIsUUFBUSxFQUFFLElBQUk7WUFDZCxZQUFZLEVBQUUsVUFBVTtZQUN4QixrQkFBa0IsRUFBRSxlQUFlO1lBQ25DLFFBQVEsRUFBRSxJQUFJO1lBQ2QsWUFBWSxFQUFFLElBQUk7WUFDbEIsaUJBQWlCLEVBQUUsSUFBSTtTQUN4QixFQUNELElBQUksQ0FDTCxDQUFBO1FBQ0QsSUFBSSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQTtRQUN0QixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQTtJQUNyQixDQUFDO0NBQ0Y7QUFsRkQsa0NBa0ZDIn0=
|
8
dist/smartacme.classes.acmecert.d.ts
vendored
8
dist/smartacme.classes.acmecert.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { IRsaKeypair } from './smartacme.classes.smartacme';
|
||||
import { AcmeAccount } from './smartacme.classes.acmeaccount';
|
||||
/**
|
||||
@ -56,7 +54,7 @@ export declare class AcmeCert {
|
||||
* @param domainNameArg - the domain name to request a challenge for
|
||||
* @param challengeType - the challenge type to request
|
||||
*/
|
||||
requestChallenge(challengeTypeArg?: TChallengeType): q.Promise<ISmartAcmeChallengeChosen>;
|
||||
requestChallenge(challengeTypeArg?: TChallengeType): Promise<ISmartAcmeChallengeChosen>;
|
||||
/**
|
||||
* checks if DNS records are set, will go through a max of 30 cycles
|
||||
*/
|
||||
@ -68,7 +66,7 @@ export declare class AcmeCert {
|
||||
/**
|
||||
* requests a certificate
|
||||
*/
|
||||
requestCert(): q.Promise<{}>;
|
||||
requestCert(): Promise<{}>;
|
||||
/**
|
||||
* getCertificate - takes care of cooldown, validation polling and certificate retrieval
|
||||
*/
|
||||
@ -76,5 +74,5 @@ export declare class AcmeCert {
|
||||
/**
|
||||
* accept a challenge - for private use only
|
||||
*/
|
||||
acceptChallenge(): q.Promise<{}>;
|
||||
acceptChallenge(): Promise<{}>;
|
||||
}
|
||||
|
5
dist/smartacme.classes.acmecert.js
vendored
5
dist/smartacme.classes.acmecert.js
vendored
File diff suppressed because one or more lines are too long
6
dist/smartacme.classes.smartacme.d.ts
vendored
6
dist/smartacme.classes.smartacme.d.ts
vendored
@ -1,5 +1,3 @@
|
||||
/// <reference types="q" />
|
||||
import * as q from 'q';
|
||||
import { AcmeAccount } from './smartacme.classes.acmeaccount';
|
||||
/**
|
||||
* a rsa keypair needed for account creation and subsequent requests
|
||||
@ -25,10 +23,10 @@ export declare class SmartAcme {
|
||||
/**
|
||||
* init the smartacme instance
|
||||
*/
|
||||
init(): q.Promise<{}>;
|
||||
init(): Promise<{}>;
|
||||
/**
|
||||
* creates an account if not currently present in module
|
||||
* @executes ASYNC
|
||||
*/
|
||||
createAcmeAccount(): q.Promise<AcmeAccount>;
|
||||
createAcmeAccount(): Promise<AcmeAccount>;
|
||||
}
|
||||
|
5
dist/smartacme.classes.smartacme.js
vendored
5
dist/smartacme.classes.smartacme.js
vendored
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// third party modules
|
||||
const q = require("q"); // promises
|
||||
const q = require("smartq"); // promises
|
||||
const plugins = require("./smartacme.plugins");
|
||||
const helpers = require("./smartacme.helpers");
|
||||
const smartacme_classes_acmeaccount_1 = require("./smartacme.classes.acmeaccount");
|
||||
@ -63,4 +64,4 @@ class SmartAcme {
|
||||
}
|
||||
}
|
||||
exports.SmartAcme = SmartAcme;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLmNsYXNzZXMuc21hcnRhY21lLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiO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ers.js
vendored
5
dist/smartacme.helpers.js
vendored
@ -1,6 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
const q = require("q");
|
||||
const q = require("smartq");
|
||||
const plugins = require("./smartacme.plugins");
|
||||
/**
|
||||
* creates a keypair to use with requests and to generate JWK from
|
||||
@ -37,4 +38,4 @@ let getReg = (SmartAcmeArg, location) => {
|
||||
});
|
||||
return done.promise;
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLmhlbHBlcnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUuaGVscGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBQ3ZCLHVCQUFzQjtBQUV0QiwrQ0FBOEM7QUFLOUM7O0dBRUc7QUFDUSxRQUFBLGFBQWEsR0FBRyxDQUFDLEdBQUcsR0FBRyxJQUFJO0lBQ2xDLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFBO0lBQzVDLE1BQU0sQ0FBQztRQUNILFNBQVMsRUFBRSxNQUFNLENBQUMsVUFBVTtRQUM1QixVQUFVLEVBQUUsTUFBTSxDQUFDLFdBQVc7S0FDakMsQ0FBQTtBQUNMLENBQUMsQ0FBQTtBQUVEOztHQUVHO0FBQ1EsUUFBQSxVQUFVLEdBQUcsQ0FBQyxhQUFxQjtJQUMxQyxNQUFNLENBQUMsa0JBQWtCLEdBQUcsYUFBYSxDQUFBO0FBQzdDLENBQUMsQ0FBQTtBQUVEOzs7R0FHRztBQUNILElBQUksTUFBTSxHQUFHLENBQUMsWUFBdUIsRUFBRSxRQUFnQjtJQUNuRCxJQUFJLElBQUksR0FBRyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUE7SU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0FBQTtJQUNoQixDQUFDLENBQ0YsQ0FBQTtJQUNELE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFBO0FBQ3JCLENBQUMsQ0FBQSJ9
|
3
dist/smartacme.paths.js
vendored
3
dist/smartacme.paths.js
vendored
@ -1,7 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const smartfile = require("smartfile");
|
||||
exports.packageDir = path.join(__dirname, '../');
|
||||
exports.assetDir = path.join(exports.packageDir, 'assets/');
|
||||
smartfile.fs.ensureDirSync(exports.assetDir);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhY21lLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw2QkFBNEI7QUFDNUIsdUNBQXNDO0FBRTNCLFFBQUEsVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFDLEtBQUssQ0FBQyxDQUFBO0FBQ3ZDLFFBQUEsUUFBUSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsa0JBQVUsRUFBQyxTQUFTLENBQUMsQ0FBQTtBQUNyRCxTQUFTLENBQUMsRUFBRSxDQUFDLGFBQWEsQ0FBQyxnQkFBUSxDQUFDLENBQUEifQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBhdGhzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRhY21lLnBhdGhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsNkJBQTRCO0FBQzVCLHVDQUFzQztBQUUzQixRQUFBLFVBQVUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBQyxLQUFLLENBQUMsQ0FBQTtBQUN2QyxRQUFBLFFBQVEsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLGtCQUFVLEVBQUMsU0FBUyxDQUFDLENBQUE7QUFDckQsU0FBUyxDQUFDLEVBQUUsQ0FBQyxhQUFhLENBQUMsZ0JBQVEsQ0FBQyxDQUFBIn0=
|
3
dist/smartacme.plugins.js
vendored
3
dist/smartacme.plugins.js
vendored
@ -1,4 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global"); // typings for node
|
||||
let rsaKeygen = require('rsa-keygen'); // rsa keygen
|
||||
exports.rsaKeygen = rsaKeygen;
|
||||
@ -15,4 +16,4 @@ const smartfile = require("smartfile");
|
||||
exports.smartfile = smartfile;
|
||||
const smartstring = require("smartstring");
|
||||
exports.smartstring = smartstring;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCLENBQUMsbUJBQW1CO0FBRzNDLElBQUksU0FBUyxHQUFHLE9BQU8sQ0FBQyxZQUFZLENBQUMsQ0FBQSxDQUFDLGFBQWE7QUFZL0MsOEJBQVM7QUFYYixJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUEsQ0FBQyx3QkFBd0I7QUFZckQsMEJBQU87QUFYWCxJQUFJLFNBQVMsR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUE7QUFZakMsOEJBQVM7QUFWYiwwQkFBMEI7QUFDMUIsK0JBQThCO0FBTTFCLHNCQUFLO0FBTFQseUNBQXdDO0FBU3BDLGdDQUFVO0FBUmQsdUNBQXNDO0FBU2xDLDhCQUFTO0FBUmIsMkNBQTBDO0FBU3RDLGtDQUFXIn0=
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRhY21lLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGFjbWUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QixDQUFDLG1CQUFtQjtBQUczQyxJQUFJLFNBQVMsR0FBRyxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUEsQ0FBQyxhQUFhO0FBWWpELDhCQUFTO0FBWFgsSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFBLENBQUMsd0JBQXdCO0FBWXZELDBCQUFPO0FBWFQsSUFBSSxTQUFTLEdBQUcsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUFBO0FBWW5DLDhCQUFTO0FBVlgsMEJBQTBCO0FBQzFCLCtCQUE4QjtBQU01QixzQkFBSztBQUxQLHlDQUF3QztBQVN0QyxnQ0FBVTtBQVJaLHVDQUFzQztBQVNwQyw4QkFBUztBQVJYLDJDQUEwQztBQVN4QyxrQ0FBVyJ9
|
34
docs/index.md
Normal file
34
docs/index.md
Normal file
@ -0,0 +1,34 @@
|
||||
## Usage
|
||||
Use TypeScript for best in class instellisense.
|
||||
|
||||
```javascript
|
||||
import { SmartAcme } from 'smartacme'
|
||||
|
||||
let smac = new SmartAcme()
|
||||
|
||||
(async () => { // learn async/await, it'll make your life easier
|
||||
|
||||
// optionally accepts a filePath Arg with a stored acmeaccount.json
|
||||
// will create an account and
|
||||
let myAccount = await smac.createAcmeAccount()
|
||||
|
||||
// will return a dnsHash to set in your DNS record
|
||||
let myCert = await myAccount.createAcmeCert('example.com')
|
||||
|
||||
// gets and accepts the specified challenge
|
||||
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
|
||||
let myChallenge = await myCert.getChallenge('dns-01')
|
||||
|
||||
/* ----------
|
||||
Now you need to set the challenge in your DNS
|
||||
myChallenge.domainNamePrefixed is the address for the record
|
||||
myChallenge.dnsKeyHash is the ready to use txt record value expected by letsencrypt
|
||||
-------------*/
|
||||
})()
|
||||
```
|
||||
|
||||
## Other relevant npm modules
|
||||
module name | description
|
||||
--- | ---
|
||||
cert | a higlevel production module that uses smartacme to manage certs
|
||||
smartnginx | a highlevel production tool for docker environments to manage nginx
|
20
package.json
20
package.json
@ -23,22 +23,20 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartacme#README",
|
||||
"dependencies": {
|
||||
"@types/node-forge": "^0.6.5",
|
||||
"@types/q": "0.x.x",
|
||||
"dnsly": "^2.0.3",
|
||||
"node-forge": "^0.6.48",
|
||||
"q": "^1.4.1",
|
||||
"@types/node-forge": "^0.6.8",
|
||||
"dnsly": "^2.0.4",
|
||||
"node-forge": "^0.7.1",
|
||||
"rawacme": "^0.2.1",
|
||||
"rsa-keygen": "^1.0.6",
|
||||
"smartdelay": "^1.0.1",
|
||||
"smartfile": "^4.1.4",
|
||||
"smartstring": "^2.0.22",
|
||||
"typings-global": "^1.0.14"
|
||||
"smartfile": "^4.1.10",
|
||||
"smartq": "^1.1.1",
|
||||
"smartstring": "^2.0.24",
|
||||
"typings-global": "^1.0.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cflare": "0.0.11",
|
||||
"cflare": "0.0.19",
|
||||
"qenv": "^1.1.3",
|
||||
"smartchai": "^1.0.1",
|
||||
"typings-test": "^1.0.3"
|
||||
"tapbundle": "^1.0.10"
|
||||
}
|
||||
}
|
||||
|
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
||||
import 'typings-test';
|
85
test/test.js
85
test/test.js
@ -1,85 +0,0 @@
|
||||
"use strict";
|
||||
require("typings-test");
|
||||
const smartchai_1 = require("smartchai");
|
||||
const cflare = require("cflare");
|
||||
const qenv = require("qenv");
|
||||
let testQenv = new qenv.Qenv(process.cwd(), process.cwd() + '/.nogit');
|
||||
// import the module to test
|
||||
const smartacme = require("../dist/index");
|
||||
let myCflareAccount = new cflare.CflareAccount();
|
||||
myCflareAccount.auth({
|
||||
email: process.env.CF_EMAIL,
|
||||
key: process.env.CF_KEY
|
||||
});
|
||||
describe('smartacme', function () {
|
||||
let testSmartAcme;
|
||||
let testAcmeAccount;
|
||||
let testAcmeCert;
|
||||
let testChallenge;
|
||||
it('should create a valid instance', function (done) {
|
||||
this.timeout(10000);
|
||||
testSmartAcme = new smartacme.SmartAcme(false);
|
||||
testSmartAcme.init().then(() => {
|
||||
smartchai_1.expect(testSmartAcme).to.be.instanceOf(smartacme.SmartAcme);
|
||||
done();
|
||||
}).catch(err => { done(err); });
|
||||
});
|
||||
it('should have created keyPair', function () {
|
||||
smartchai_1.expect(testSmartAcme.acmeUrl).to.be.a('string');
|
||||
});
|
||||
it('should register a new account', function (done) {
|
||||
this.timeout(10000);
|
||||
testSmartAcme.createAcmeAccount().then(x => {
|
||||
testAcmeAccount = x;
|
||||
done();
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
it('should create a AcmeCert', function () {
|
||||
testAcmeAccount.createAcmeCert('test2.bleu.de').then(x => {
|
||||
testAcmeCert = x;
|
||||
smartchai_1.expect(testAcmeAccount).to.be.instanceOf(smartacme.AcmeCert);
|
||||
});
|
||||
});
|
||||
it('should get a challenge for a AcmeCert', function (done) {
|
||||
this.timeout(10000);
|
||||
testAcmeCert.requestChallenge().then((challengeChosen) => {
|
||||
console.log(challengeChosen);
|
||||
testChallenge = challengeChosen;
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('should set the challenge', function (done) {
|
||||
this.timeout(20000);
|
||||
myCflareAccount.createRecord(testChallenge.domainNamePrefixed, 'TXT', testChallenge.dnsKeyHash).then(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('should check for a DNS record', function (done) {
|
||||
this.timeout(20000);
|
||||
testAcmeCert.checkDns().then(x => {
|
||||
console.log(x);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('should accept the challenge', function (done) {
|
||||
this.timeout(10000);
|
||||
testAcmeCert.acceptChallenge().then(() => { done(); });
|
||||
});
|
||||
it('should poll for validation of a challenge', function (done) {
|
||||
this.timeout(10000);
|
||||
testAcmeCert.requestValidation().then(x => {
|
||||
console.log(x);
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('should remove the challenge', function (done) {
|
||||
this.timeout(20000);
|
||||
myCflareAccount.removeRecord(testChallenge.domainNamePrefixed, 'TXT').then(() => {
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQix5Q0FBa0M7QUFDbEMsaUNBQWdDO0FBQ2hDLDZCQUE0QjtBQUU1QixJQUFJLFFBQVEsR0FBRyxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLE9BQU8sQ0FBQyxHQUFHLEVBQUUsR0FBRyxTQUFTLENBQUMsQ0FBQTtBQUV0RSw0QkFBNEI7QUFDNUIsMkNBQTBDO0FBRTFDLElBQUksZUFBZSxHQUFHLElBQUksTUFBTSxDQUFDLGFBQWEsRUFBRSxDQUFBO0FBQ2hELGVBQWUsQ0FBQyxJQUFJLENBQUM7SUFDakIsS0FBSyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUTtJQUMzQixHQUFHLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNO0NBQzFCLENBQUMsQ0FBQTtBQUVGLFFBQVEsQ0FBQyxXQUFXLEVBQUU7SUFDbEIs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DQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQTtRQUNuQixlQUFlLENBQUMsWUFBWSxDQUN4QixhQUFhLENBQUMsa0JBQWtCLEVBQ2hDLEtBQUssQ0FDUixDQUFDLElBQUksQ0FBQztZQUNILElBQUksRUFBRSxDQUFBO1FBQ1YsQ0FBQyxDQUFDLENBQUE7SUFDTixDQUFDLENBQUMsQ0FBQTtBQUNOLENBQUMsQ0FBQyxDQUFBIn0=
|
79
test/test.ts
79
test/test.ts
@ -1,5 +1,4 @@
|
||||
import 'typings-test'
|
||||
import { expect } from 'smartchai'
|
||||
import { expect, tap } from 'tapbundle'
|
||||
import * as cflare from 'cflare'
|
||||
import * as qenv from 'qenv'
|
||||
|
||||
@ -14,90 +13,78 @@ myCflareAccount.auth({
|
||||
key: process.env.CF_KEY
|
||||
})
|
||||
|
||||
describe('smartacme', function () {
|
||||
let testSmartAcme: smartacme.SmartAcme
|
||||
let testAcmeAccount: smartacme.AcmeAccount
|
||||
let testAcmeCert: smartacme.AcmeCert
|
||||
let testChallenge: smartacme.ISmartAcmeChallengeChosen
|
||||
|
||||
it('should create a valid instance', function (done) {
|
||||
this.timeout(10000)
|
||||
tap.test('smartacme -> should create a valid instance', async (tools) => {
|
||||
tools.timeout(10000)
|
||||
testSmartAcme = new smartacme.SmartAcme(false)
|
||||
testSmartAcme.init().then(() => {
|
||||
await testSmartAcme.init().then(async () => {
|
||||
expect(testSmartAcme).to.be.instanceOf(smartacme.SmartAcme)
|
||||
done()
|
||||
}).catch(err => { done(err) })
|
||||
})
|
||||
})
|
||||
|
||||
it('should have created keyPair', function () {
|
||||
tap.test('smartacme -> should have created keyPair', async () => {
|
||||
expect(testSmartAcme.acmeUrl).to.be.a('string')
|
||||
})
|
||||
|
||||
it('should register a new account', function (done) {
|
||||
this.timeout(10000)
|
||||
testSmartAcme.createAcmeAccount().then(x => {
|
||||
tap.test('smartacme -> should register a new account', async (tools) => {
|
||||
tools.timeout(10000)
|
||||
await testSmartAcme.createAcmeAccount().then(async x => {
|
||||
testAcmeAccount = x
|
||||
done()
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
done(err)
|
||||
})
|
||||
})
|
||||
|
||||
it('should create a AcmeCert', function() {
|
||||
testAcmeAccount.createAcmeCert('test2.bleu.de').then(x => {
|
||||
tap.test('smartacme -> should create a AcmeCert', async () => {
|
||||
await testAcmeAccount.createAcmeCert('test2.bleu.de').then(async x => {
|
||||
testAcmeCert = x
|
||||
expect(testAcmeAccount).to.be.instanceOf(smartacme.AcmeCert)
|
||||
})
|
||||
})
|
||||
|
||||
it('should get a challenge for a AcmeCert', function (done) {
|
||||
this.timeout(10000)
|
||||
testAcmeCert.requestChallenge().then((challengeChosen) => {
|
||||
tap.test('smartacme -> should get a challenge for a AcmeCert', async (tools) => {
|
||||
tools.timeout(10000)
|
||||
await testAcmeCert.requestChallenge().then(async (challengeChosen) => {
|
||||
console.log(challengeChosen)
|
||||
testChallenge = challengeChosen
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should set the challenge', function(done) {
|
||||
this.timeout(20000)
|
||||
myCflareAccount.createRecord(
|
||||
tap.test('smartacme -> should set the challenge', async (tools) => {
|
||||
tools.timeout(20000)
|
||||
await myCflareAccount.createRecord(
|
||||
testChallenge.domainNamePrefixed,
|
||||
'TXT', testChallenge.dnsKeyHash
|
||||
).then(() => {
|
||||
done()
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it('should check for a DNS record', function(done) {
|
||||
this.timeout(20000)
|
||||
testAcmeCert.checkDns().then(x => {
|
||||
tap.test('smartacme -> should check for a DNS record', async (tools) => {
|
||||
tools.timeout(20000)
|
||||
await testAcmeCert.checkDns().then(x => {
|
||||
console.log(x)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should accept the challenge', function(done){
|
||||
this.timeout(10000)
|
||||
testAcmeCert.acceptChallenge().then(() => { done() })
|
||||
tap.test('smartacme -> should accept the challenge', async (tools) => {
|
||||
tools.timeout(10000)
|
||||
await testAcmeCert.acceptChallenge()
|
||||
})
|
||||
|
||||
it('should poll for validation of a challenge', function (done) {
|
||||
this.timeout(10000)
|
||||
testAcmeCert.requestValidation().then(x => {
|
||||
tap.test('smartacme -> should poll for validation of a challenge', async (tools) => {
|
||||
tools.timeout(10000)
|
||||
await testAcmeCert.requestValidation().then(async x => {
|
||||
console.log(x)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should remove the challenge', function(done) {
|
||||
this.timeout(20000)
|
||||
myCflareAccount.removeRecord(
|
||||
tap.test('smartacme -> should remove the challenge', async (tools) => {
|
||||
tools.timeout(20000)
|
||||
await myCflareAccount.removeRecord(
|
||||
testChallenge.domainNamePrefixed,
|
||||
'TXT'
|
||||
).then(() => {
|
||||
done()
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
tap.start()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as plugins from './smartacme.plugins'
|
||||
import * as helpers from './smartacme.helpers'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as plugins from './smartacme.plugins'
|
||||
import * as helpers from './smartacme.helpers'
|
||||
|
@ -1,5 +1,5 @@
|
||||
// third party modules
|
||||
import * as q from 'q' // promises
|
||||
import * as q from 'smartq' // promises
|
||||
import * as plugins from './smartacme.plugins'
|
||||
import * as helpers from './smartacme.helpers'
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import 'typings-global'
|
||||
import * as q from 'q'
|
||||
import * as q from 'smartq'
|
||||
|
||||
import * as plugins from './smartacme.plugins'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user