Friday 19 May 2017

Encryption using direct S3 upload and Node signing with ng-file-upload

I am using ng-file-upload to upload directly to S3 as seen in the example here: Direct S3 upload and Node signing example

I've included 'x-amz-server-side-encryption': 'AES256' in my headers, and its being sent with the request.

                  Upload.upload({
                      url: result.data.url, //s3Url
                      headers: { 'x-amz-server-side-encryption': 'AES256' },
                      transformRequest: function(data, headersGetter) {
                          var headers = headersGetter();
                          delete headers.Authorization;
                          return data;
                      },
                      fields: result.data.fields, //credentials
                      method: 'POST',
                      file: files[0]
                  }

The file uploads successfully, but the files are not being encrypted once uploaded. I've also noticed the response headers do not include 'x-amz-server-side-encryption'

Is this an s3 config error? Or is this an implementation error with ng-file-upload?



via khndrx

No comments:

Post a Comment