question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support ServerSideEncryption

See original GitHub issue

At the moment it looks like the upload function is used but does’t accept an option to pass in the ServerSideEncryption header. The upload function takes the same params as the the putObject function:

s3.putObject({
        Bucket: bucketName,
        Key: key,
        Body: fileStream,
        ServerSideEncryption: 'AES256',
        Metadata: { 'docId': 'DOCID', 'docKey': 'XYZZY', 'index': 'pdf' }
})

Reference for the above

It would be great if the disk.write updated usage could look like this:

 await this.disk.write(path, file.buffer, {
      name,
      ServerSideEncryption: 'AES256'
 });

FoalTS is fantastic btw, awesome work!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LoicPoullaincommented, Feb 1, 2022

Ok thanks. 👍

Yes, so I think the best place to specify the option will be in the configuration then. It will allow us to keep using the generic Disk and @ValidateMultipartBody hook in this case. In this way, we will still be able to write a unique code that uses the local file system in development (for testing) and the S3 bucket in production.

1reaction
LoicPoullaincommented, Jan 11, 2022

FoalTS is fantastic btw, awesome work!

Thank you!

Hi @LoicPoullain have you had any chance to take a look at this?

I’m thinking of adding a fourth parameter (not the third) to the write function to pass custom options to the putObject method. This would be specific to the S3Disk service (and not Disk).

I still need to think about this to check that it won’t introduce backward incompatibility, especially on the typing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Protecting data using server-side encryption
Server-side encryption is the encryption of data at its destination by the application or service that receives it. Amazon S3 encrypts your data...
Read more >
ServerSideEncryption (AWS SDK for Java - 2.18.35)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum...
Read more >
AWS S3 Encryption - Jayendra's Cloud Certification Blog
AWS S3 Encryption supports but encryption in transit using TLS and encryption at rest support both client and server side encryption.
Read more >
Object Storage Service:Server-side encryption - Alibaba Cloud
Object Storage Service (OSS) encrypts objects uploaded to a bucket that has server-side encryption enabled and stores the encrypted objects.
Read more >
Does s3cmd support Amazon S3 server-side encryption?
Does s3cmd support Amazon S3 server-side encryption? Yes, file encryption can optionally be used to make a backup/upload to S3 more secure. Files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found