v3.0.5: update for greenlock express v3

This commit is contained in:
AJ ONeal 2019-10-28 22:57:05 -06:00
parent b80ab1ae54
commit cc0dd5bb35
2 changed files with 28 additions and 22 deletions

View File

@ -1,19 +1,19 @@
'use strict'; 'use strict';
//var request;
var defaults = {}; var defaults = {};
var _memdb = {};
module.exports.create = function(config) { module.exports.create = function(config) {
var memdb = config.cache || {}; var memdb = config.cache || _memdb;
return { return {
init: function(opts) { init: function(opts) {
//request = opts.request; //request = opts.request;
return null; return Promise.resolve(null);
}, },
set: function(data) { set: function(data) {
return Promise.resolve().then(function() {
// console.log('Add Key Auth URL', data); // console.log('Add Key Auth URL', data);
var ch = data.challenge; var ch = data.challenge;
@ -21,9 +21,11 @@ module.exports.create = function(config) {
memdb[key] = ch.keyAuthorization; memdb[key] = ch.keyAuthorization;
return null; return null;
});
}, },
get: function(data) { get: function(data) {
return Promise.resolve().then(function() {
// console.log('List Key Auth URL', data); // console.log('List Key Auth URL', data);
var ch = data.challenge; var ch = data.challenge;
@ -34,9 +36,11 @@ module.exports.create = function(config) {
} }
return null; return null;
});
}, },
remove: function(data) { remove: function(data) {
return Promise.resolve().then(function() {
// console.log('Remove Key Auth URL', data); // console.log('Remove Key Auth URL', data);
var ch = data.challenge; var ch = data.challenge;
@ -44,6 +48,7 @@ module.exports.create = function(config) {
delete memdb[key]; delete memdb[key];
return null; return null;
});
} }
}; };
}; };

View File

@ -1,9 +1,10 @@
{ {
"name": "acme-http-01-standalone", "name": "acme-http-01-standalone",
"version": "3.0.0", "version": "3.0.5",
"description": "HTTP Authentication (In-Memory) for Let's Encrypt for Node.js - ACME http-01 challenges w/ ACME.js and Greenlock.js", "description": "HTTP Authentication (In-Memory) for Let's Encrypt for Node.js - ACME http-01 challenges w/ ACME.js and Greenlock.js",
"main": "index.js", "main": "index.js",
"files": [ "files": [
"*.js",
"lib", "lib",
"test.js" "test.js"
], ],