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

12 lines
474 B
JavaScript

module.exports.get = (opts, options, s3) => {
let challengeKey = options.directory + opts.challenge.token;
return s3.getObject({ Key: challengeKey, Bucket: options.bucketName }).promise().then(function (data) {
console.log('Successfully retrieved challenge.' + data.Body.toString());
return {
keyAuthorization: data.Body.toString()
}
}).catch(function (err) {
console.error(err.message);
return null;
});
}