Comments (13)
Thank you. I just raised the concern there. I suspect it's minio's responsability and the header is just not present there.
from miniopy-async.
stat = await storage.stat_object(
userid, child.object_name, request_headers={
"x-amz-checksum-mode": "ENABLED"
})
<CIMultiDictProxy('Accept-Ranges': 'bytes', 'Content-Length': '66113', 'Content-Type': 'image/jpeg', 'Etag': '"aa183ad8c63be503136cf2cb6f364c9a"', 'Last-Modified': 'Fri, 17 Nov 2023 11:53:38 GMT', 'Server': 'MinIO', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'Vary': 'Origin', 'Vary': 'Accept-Encoding', 'X-Amz-Checksum-Sha256': 'MGCj+pPNMgMINi1y/RL1qZtCIyZCBWyFPLwtDtlWtdU=', 'X-Amz-Id-2': 'dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8', 'X-Amz-Request-Id': '179866FF4F9AC0FE', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'x-amz-meta-filename': 'unnamed.jpg', 'Date': 'Fri, 17 Nov 2023 11:55:06 GMT')>
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.
from miniopy-async.
I've tried this in official minio-py, and the result is the same, no such x-amz-checksum-X
header.
I think you should open an issue there.
from miniopy-async.
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).
from miniopy-async.
from miniopy-async.
get_object
and fget_object
have the ability to get an extra dict of request headers. Maybe this could be done for stat_object
.
from miniopy-async.
I still can't get it even in get_object
.
What's your parameters in put_object
and get_object
? I guess I missed something.
from miniopy-async.
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).
from miniopy-async.
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
},
)
from miniopy-async.
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
from miniopy-async.
ok, i got it.
from miniopy-async.
Done.
Please update using pip install git+https://github.com/hlf20010508/miniopy-async.git
to have a test.
If nothing wrong, I'll publish new version
from miniopy-async.
You're welcome.
New version published.
from miniopy-async.
Related Issues (15)
- Is there any more detailed Useage? HOT 2
- Custom metadata
- warning msg: Unclosed client session, Unclosed connector HOT 2
- async def _get_region blocks forever HOT 2
- session argument ignored in method _execute HOT 3
- Can't import aiostream HOT 2
- Add snowball object HOT 3
- `get_object` has required session parameter but other methods hasn't session parameter. Why for? HOT 3
- [SSLCertVerificationError]: How do I ignore checking a self-signed certificate HOT 4
- Consider distributing on conda-forge HOT 4
- Reorganize and format the code HOT 1
- update to the latest version of official minio python driver (minio-py) HOT 3
- support async method read() in read_part_data HOT 1
- fget_object downloads zero size files HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miniopy-async.