2
0
mirror of https://github.com/cderche/greenlock-challenge-s3 synced 2025-05-10 15:36:33 +00:00

log challengeKey

This commit is contained in:
Cyrille 2019-05-08 17:50:45 +01:00
parent d89a1c8b2a
commit d95a4bb6a9
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,7 @@
module.exports.get = (opts, options, s3) => {
let challengeKey = options.directory + opts.challenge.token;
let challengeKey = path.join(options.directory, opts.challenge.token);
console.log('get', challengeKey);
return s3.getObject({ Key: challengeKey, Bucket: options.bucketName }).promise().then(function (data) {
console.log('Successfully retrieved challenge.' + data.Body.toString());
return {

View File

@ -1,5 +1,7 @@
module.exports.remove = (opts, options, s3) => {
challengeKey = options.directory + opts.challenge.token;
let challengeKey = path.join(options.directory, opts.challenge.token);
console.log('remove', challengeKey);
return s3.deleteObject({ Key: challengeKey, Bucket: options.bucketName }).promise().then(function (data) {
console.log('Successfully deleted challenge.');
return data;

View File

@ -1,8 +1,8 @@
const path = require('path');
module.exports.set = (opts, options, s3) => {
var challengeKey = path.join(options.directory, opts.challenge.token);
console.log(challengeKey);
let challengeKey = path.join(options.directory, opts.challenge.token);
console.log('set', challengeKey);
return s3.putObject({ Key: challengeKey, Body: opts.challenge.keyAuthorization, Bucket: options.bucketName }).promise().then(function (data) {
console.log('Successfully created challenge.');