pplu / aws-sdk-perl

A community AWS SDK for Perl Programmers
Other
170 stars 94 forks source link

Glacier UploadPart sha calculations (maybe range too?) #370

Open castaway opened 4 years ago

castaway commented 4 years ago

Glacier Upload Archive and Multipart upload requires a x-amz-sha256-tree-hash header (See https://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.html) with each part having an sha hash tree of its content per 1MB chunk, and the CompleteMultiPart upload having the whole thing.

UploadArchive also needs an sha hash tree of the whole content per 1MB chunk.

Multipart Upload also wants a Content-Range header per part, eg "bytes 0-1048575/*" for the first part of an upload with 1MB parts.

Can we handle any of these in RestJsonCaller like the Content-Length headers or would we need to add a "simplification layer" for ease of use?

See also #30

pplu commented 4 years ago

Looks OK to handle in RestJsonCaller. If it's very Glacier specific, we can create a specialized caller for Glacier, and make the code generation put that caller in the Glacier API. This has already been done with EC2:

https://github.com/pplu/aws-sdk-perl/blob/master/builder-bin/gen_classes.pl#L82 https://github.com/pplu/aws-sdk-perl/blob/master/builder-lib/Paws/API/Builder/EC2.pm