use the backupdb config to determine bucket and prefix

This commit is contained in:
Girish Ramakrishnan
2016-03-31 00:50:53 -07:00
parent f3a05931df
commit 39cc5d07d1
3 changed files with 23 additions and 23 deletions

View File

@@ -1,5 +1,3 @@
/* jslint node:true */
'use strict';
exports = module.exports = {
@@ -87,9 +85,9 @@ function getSignedUploadUrl(backupConfig, filename, callback) {
});
}
function getSignedDownloadUrl(backupConfig, filename, callback) {
function getSignedDownloadUrl(backupConfig, info, callback) {
assert.strictEqual(typeof backupConfig, 'object');
assert.strictEqual(typeof filename, 'string');
assert.strictEqual(typeof info, 'object');
assert.strictEqual(typeof callback, 'function');
getBackupCredentials(backupConfig, function (error, credentials) {
@@ -98,8 +96,8 @@ function getSignedDownloadUrl(backupConfig, filename, callback) {
var s3 = new AWS.S3(credentials);
var params = {
Bucket: backupConfig.bucket,
Key: backupConfig.prefix + '/' + filename,
Bucket: info.bucket,
Key: info.prefix + '/' + info.filename,
Expires: 60 * 30 /* 30 minutes */
};