mirror of
https://git.coolaj86.com/coolaj86/greenlock-store-memory.js.git
synced 2025-04-20 13:00:36 +00:00
v3.0.2: clarify with comments and docs
This commit is contained in:
parent
5a66693cdb
commit
6922fb2e97
21
index.js
21
index.js
@ -69,12 +69,10 @@ module.exports.create = function (opts) {
|
|||||||
var id = opts.account.id || opts.email || 'default';
|
var id = opts.account.id || opts.email || 'default';
|
||||||
var keypair = opts.keypair;
|
var keypair = opts.keypair;
|
||||||
|
|
||||||
saveKeypair(id, JSON.stringify({
|
return saveKeypair(id, JSON.stringify({
|
||||||
privateKeyPem: keypair.privateKeyPem
|
privateKeyPem: keypair.privateKeyPem
|
||||||
, privateKeyJwk: keypair.privateKeyJwk
|
, privateKeyJwk: keypair.privateKeyJwk
|
||||||
}));
|
})); // Must return or Promise `null` instead of `undefined`
|
||||||
|
|
||||||
return null; // or Promise.resolve(null);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -121,14 +119,13 @@ module.exports.create = function (opts) {
|
|||||||
var id = opts.certificate.kid || opts.certificate.id || opts.subject;
|
var id = opts.certificate.kid || opts.certificate.id || opts.subject;
|
||||||
var keypair = opts.keypair;
|
var keypair = opts.keypair;
|
||||||
|
|
||||||
saveKeypair(id, JSON.stringify({
|
return saveKeypair(id, JSON.stringify({
|
||||||
privateKeyPem: keypair.privateKeyPem
|
privateKeyPem: keypair.privateKeyPem
|
||||||
, privateKeyJwk: keypair.privateKeyJwk
|
, privateKeyJwk: keypair.privateKeyJwk
|
||||||
}));
|
})); // Must return or Promise `null` instead of `undefined`
|
||||||
// Note: you can use the "keypairs" package to convert between
|
|
||||||
// public and private for jwk and pem, as well as convert JWK <-> PEM
|
|
||||||
|
|
||||||
return null;
|
// Side Note: you can use the "keypairs" package to convert between
|
||||||
|
// public and private for jwk and pem, as well as convert JWK <-> PEM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -155,16 +152,14 @@ module.exports.create = function (opts) {
|
|||||||
|
|
||||||
var id = opts.certificate.id || opts.subject;
|
var id = opts.certificate.id || opts.subject;
|
||||||
var pems = opts.pems;
|
var pems = opts.pems;
|
||||||
saveCertificate(id, JSON.stringify({
|
return saveCertificate(id, JSON.stringify({
|
||||||
cert: pems.cert
|
cert: pems.cert
|
||||||
, chain: pems.chain
|
, chain: pems.chain
|
||||||
, subject: pems.subject
|
, subject: pems.subject
|
||||||
, altnames: pems.altnames
|
, altnames: pems.altnames
|
||||||
, issuedAt: pems.issuedAt // a.k.a. NotBefore
|
, issuedAt: pems.issuedAt // a.k.a. NotBefore
|
||||||
, expiresAt: pems.expiresAt // a.k.a. NotAfter
|
, expiresAt: pems.expiresAt // a.k.a. NotAfter
|
||||||
}));
|
})); // Must return or Promise `null` instead of `undefined`
|
||||||
|
|
||||||
return null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "greenlock-store-memory",
|
"name": "greenlock-store-memory",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"lockfileVersion": 1
|
"lockfileVersion": 1
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "greenlock-store-memory",
|
"name": "greenlock-store-memory",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"description": "An in-memory reference implementation for account, certificate, and keypair storage strategies in Greenlock",
|
"description": "An in-memory reference implementation for account, certificate, and keypair storage strategies in Greenlock",
|
||||||
"homepage": "https://git.coolaj86.com/coolaj86/greenlock-store-memory.js",
|
"homepage": "https://git.coolaj86.com/coolaj86/greenlock-store-memory.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user