Merge pull request #228 from timowolf/master
feat(aws-options): add AWS S3 options for server side encryption
This commit is contained in:
commit
1e71f7d8dd
|
@ -141,6 +141,30 @@ exports.upload = function(provider, req, res, options, cb) {
|
||||||
uploadParams.acl = file.acl;
|
uploadParams.acl = file.acl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add AWS specific options
|
||||||
|
// See http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#upload-property
|
||||||
|
if (options.StorageClass) {
|
||||||
|
uploadParams.StorageClass = options.StorageClass;
|
||||||
|
}
|
||||||
|
if (options.CacheControl) {
|
||||||
|
uploadParams.CacheControl = options.CacheControl;
|
||||||
|
}
|
||||||
|
if (options.ServerSideEncryption) {
|
||||||
|
uploadParams.ServerSideEncryption = options.ServerSideEncryption;
|
||||||
|
}
|
||||||
|
if (options.SSEKMSKeyId) {
|
||||||
|
uploadParams.SSEKMSKeyId = options.SSEKMSKeyId;
|
||||||
|
}
|
||||||
|
if (options.SSECustomerAlgorithm) {
|
||||||
|
uploadParams.SSECustomerAlgorithm = options.SSECustomerAlgorithm;
|
||||||
|
}
|
||||||
|
if (options.SSECustomerKey) {
|
||||||
|
uploadParams.SSECustomerKey = options.SSECustomerKey;
|
||||||
|
}
|
||||||
|
if (options.SSECustomerKeyMD5) {
|
||||||
|
uploadParams.SSECustomerKeyMD5 = options.SSECustomerKeyMD5;
|
||||||
|
}
|
||||||
|
|
||||||
var writer = provider.upload(uploadParams);
|
var writer = provider.upload(uploadParams);
|
||||||
|
|
||||||
writer.on('error', function(err) {
|
writer.on('error', function(err) {
|
||||||
|
|
Loading…
Reference in New Issue