aws-amplify/amplify-swift

Uploading a file using Amplify.Storage.uploadFile doesn't appear to support specifying a checksum algorithm.

sbelbin opened this issue · 2 comments

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

Storage

Is this related to another service?

No response

Describe the feature you'd like to request

When using the Amplify.Storage.uploadFile function to upload a file, this message appear at the start of each upload. This occurs when implementing a Swift app that is running on a iPad that is running iOS 17.5.1.

info S3Client : [Logging] No checksum provided! Skipping flexible checksums workflow...

While the file uploads correctly, it's preferable to be able to configure the checksum algorithm as to ensure that contents delivered into the AWS S3 bucket matches the checksum of the original file.

Describe the solution you'd like

The AWS SDK Swift CreateMultipartUploadRequest supports specifying the checksum algorithm, see below:

CreateMultipartUploadRequest.builder() .bucket(BUCKET) .key(FILE_NAME) .checksumAlgorithm(ChecksumAlgorithm.SHA256) .build();

My request is for AWS Amplify Storage support this.

My preference is being able to provide a parameter/option to the uploadFile, uploadData and other functions which transfer data to/from the AWS S3 bucket.

Alternative solutions is to define the checksum algorithm as part of the AWS Amplify backend definition (storage/resource.ts) or being able to configure the Amplify.Storage instance to a checksum algorithm.

Describe alternatives you've considered

As mentioned, while I could use AWS Amplify trap door to get the S3Client instance to the AWS S3 bucket and to use CreateMultipartUploadRequest as to specify the checksum algorithm.

However, my mindset is that AWS Amplify Storage was conceived to simplify transferring of data and implementing a multi-part upload would be excessive.

Additional context

My opinion on the matter is that a checksum algorithm should be applied by default, since it a good practice for ensuring data transfer was done correctly.

For situations where it's not wanted, such as it introduces a performance overhead, then those applications could opt-out.

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

Hello, @sbelbin and thanks for opening this issue. Since this is related to a Swift app, I'll actually transfer this over the the amplify-swift repository to ensure they have this feature request tracked as well. We currently have issue aws-amplify/amplify-js#11776 that is tracking this for the JS side.

Thank you for posting the feature request. Our team would take a look and post updates here.