amazonka-s3-streaming
amazonka-s3-streaming copied to clipboard
Compute hash of input bytestrings and include those in the completed CompleteMultipartUpload
CompleteMultipartUpload has fields to include several hash digests, it wouldn't be hard in streamUpload to compute these from the data coming into the conduit and including that at the end. This should be easy to do efficiently with a combination of cryptonite and some of the modules in amazonka-core.
One big benefit of this is making testing simpler, at the moment I upload a file to S3, download it and check the hash matches; if the hash is computed from the input data and not anything internal to buffers etc, then Amazon will do the work of checking that the hash matches for us, and hopefully return an error if we ever mess up uploading.
Sadly it looks like this won't work how I hoped, AWS won't compute the checksum of the total object, only the checksum of the concatenated checksums. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html