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,49 +1,54 @@
'use strict';
//var request;
var defaults = {};
var _memdb = {};
module.exports.create = function(config) {
var memdb = config.cache || {};
var memdb = config.cache || _memdb;
return {
init: function(opts) {
//request = opts.request;
return null;
return Promise.resolve(null);
},
set: function(data) {
// console.log('Add Key Auth URL', data);
return Promise.resolve().then(function() {
// console.log('Add Key Auth URL', data);
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
memdb[key] = ch.keyAuthorization;
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
memdb[key] = ch.keyAuthorization;
return null;
return null;
});
},
get: function(data) {
// console.log('List Key Auth URL', data);
return Promise.resolve().then(function() {
// console.log('List Key Auth URL', data);
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
if (memdb[key]) {
return { keyAuthorization: memdb[key] };
}
if (memdb[key]) {
return { keyAuthorization: memdb[key] };
}
return null;
return null;
});
},
remove: function(data) {
// console.log('Remove Key Auth URL', data);
return Promise.resolve().then(function() {
// console.log('Remove Key Auth URL', data);
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
var ch = data.challenge;
var key = ch.identifier.value + '#' + ch.token;
delete memdb[key];
return null;
delete memdb[key];
return null;
});
}
};
};

View File

@ -1,9 +1,10 @@
{
"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",
"main": "index.js",
"files": [
"*.js",
"lib",
"test.js"
],