Tags: zio/zio-s3
Tags
[FEATURE] Add contentMD5 for `putObject` to support object locking (#394 ) * [FEATURE] Add contentMD5 for `putObject` to support object locking We are hitting an error when using this library because our bucket is configured with [object locking](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html): ``` Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters (Service: S3, Status Code: 400, Request ID: XXX, Extended Request ID: XXX) ``` The AWS S3 API requires passing the `Content-MD5` option for `putObject` requests that target buckets with object locking enabled. From the [`putObject` API description](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html): > To ensure that data is not corrupted traversing the network, use the Content-MD5 header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, returns an error. Additionally, you can calculate the MD5 while putting an object to Amazon S3 and compare the returned ETag to the calculated MD5 value. > The Content-MD5 header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview in the Amazon S3 User Guide. This MR adds a BC support for passing an `Option[String]` as contentMD5, which is a base64 encoded MD5 hash. The library users will be responsible to provide a correct contentMD5. * Fix scaladoc
PreviousNext