Meteor-Community-Packages/Meteor-CollectionFS

Enable server side encryption (SSE) with Amazon S3 bucket

Closed this issue · 1 comments

Hi, first off, thanks for the amazing work!

I have the S3 store working, but am trying to enable server side encryption (SSE). After a file is uploaded its not being encrypted. If I follow this procedure and add a bucket policy to deny non-encrypted puts, it says access denied:
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html

Without the bucket policy, the files save fine, but the properties show it not encrypted.

Here is the basic config:
var docStore = new FS.Store.S3("docs", {
region: "us-west-1",
accessKeyId: "XXXX",
secretAccessKey: "XXXX",
bucket: "files",
ServerSideEncryption: "AES256"
});

Docs = new FS.Collection("docs", {
stores: [docStore],
filter: {
maxSize: 31457280, // in bytes
onInvalid: function (message) {
console.log(message);
}
}
});


What am I missing? It seems the header isn't being sent, is that the correct config option, ServerSideEncryption: "AES256"

TIA!

Fixed it, read through the API guide again and missed the proper syntax. These items must be in a params object. For anyone wondering:
API Guide for NodeJS:
http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html

Correct Code:
var docStore = new FS.Store.S3("docs", {
params: {ServerSideEncryption: "AES256"},
region: "us-west-1",
accessKeyId: "XXXX",
secretAccessKey: "XXXX",
bucket: "files",
});