minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
851 stars 325 forks source link

Checksum in object stat/get #1330

Open trollfot opened 11 months ago

trollfot commented 11 months ago

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

klauspost commented 11 months ago

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.

trollfot commented 11 months ago

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).

balamurugana commented 11 months ago

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