-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checksum in object stat/get #21
Comments
I've tried this in official minio-py, and the result is the same, no such |
Thank you. I just raised the concern there. I suspect it's minio's responsability and the header is just not present there. |
It seems the query functions do not allow for extra headers to be added and a special header is needed to get the checksum back. Currently, The only headers passed along are the server side encryption (ssec). |
|
I still can't get it even in |
It seems that, to get back a checksum header, you have to set a request header "x-amz-checksum-mode: ENABLED". (https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_RequestSyntax). You need to have set a "x-amz-checksum-X" header on the put_object (x-amz-checksum-sha256 for example). |
You mean like this? import hashlib
import base64
import io
buffer = io.BytesIO('test')
sha256 = hashlib.sha256(buffer.getvalue()).digest()
b64_sha256 = base64.b64encode(sha256).decode()
client.put_object(
"my-bucket",
"my-object",
buffer,
len(buffer.getvalue()),
metadata={
'x-amz-checksum-mode': 'ENABLED',
'x-amz-checksum-sha256': b64_sha256
},
) |
As i understand it from the docs, 'x-amz-checksum-mode': 'ENABLED', is only required on get/head methods, to signal the server that you want the checksum back as a metadata with the rest of the info |
ok, i got it. |
Done. |
The checksum is there, as expected. I had a look at the code, it's now symmetrical with the other get methods. I think it's very nice and a special thank you to you for the reactivity and help. |
You're welcome. |
Hello
Bug Report
Describe the bug
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
The text was updated successfully, but these errors were encountered: