minio-py icon indicating copy to clipboard operation
minio-py copied to clipboard

Checksum in object stat/get

Open trollfot opened this issue 1 year ago • 3 comments

Hello

As I understand from the S3 docs, when providing a "x-amz-checksum-X" header to put an object, the same header should be returned upon stat/get (HEAD/GET). It's currently not the case. Is it due to minio headers generation ? Reading the raw request in the stat does not yield any more result.

To Reproduce

upload a file via "put_object" with a "x-amz-checksum-X" header that is valid. Stat or Get the object.

Expected behavior

The header should be present

trollfot avatar Nov 16 '23 15:11 trollfot

You must set x-amz-checksum-mode: ENABLED in the request header. https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_RequestSyntax

Not sure to what extent this SDK supports checksums.

klauspost avatar Nov 16 '23 15:11 klauspost

It seems the query functions do not allow for extra headers to be added, unless i'm mistaken. The only headers passed along are the server side encryption (ssec).

trollfot avatar Nov 16 '23 16:11 trollfot

@trollfot stat_object() doesn't support extra headers yet. Feel free to send a PR for that.

balamurugana avatar Nov 16 '23 17:11 balamurugana