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
Question about PresignedPutObject API #1535
Comments
https://pkg.go.dev/github.com/minio/minio-go/v7?utm_source=godoc#Client.Presign use this to construct whatever you like. |
Thanks for your answer. |
I found that there is a PR #1449 like my question. |
you can add the x-amz-content-sha256 as part of the url.Values{} query param. |
I tested and found that it just add a query kv into url. (Will this be inclued into signature?) And I even can not use that url to put object. I am trying to solve this problem. |
I have tried to add the x-amz-content-sha256 as part of the url.Values{} query param. // ok
//u, err := minioClient.PresignedPutObject(context.TODO(), "test", "hello", 10*time.Minute)
// ok
//u, err := minioClient.Presign(context.TODO(), "PUT", "test", "hello", 10*time.Minute, url.Values{"hh": []string{sha}})
// failed 403
//u, err := minioClient.Presign(context.TODO(), "PUT", "test", "hello", 10*time.Minute, url.Values{"X-Amz-Content-Sha256": []string{sha}})
// failed 403
u, err := minioClient.Presign(context.TODO(), "PUT", "test", "hello", 10*time.Minute, url.Values{"x-amz-content-sha256": []string{sha}}) |
https://pkg.go.dev/github.com/minio/minio-go/v7#Client.PresignHeader - This the API that addresses x-amz-content-sha256 requirement. |
Thanks for the prefect open source tools.
When I use minio SDK, I try to get a PresignedPutObject for others (not controlled by me) to put object into it.
I think I need some limits about the presigned url.
I found the header like 'x-amz-content-sha256' can do that. I can limit the user of the presigned put object url that they can only upload specific file. Of course, the object will not been shown before it has been already uploaded.
However, there are no chance in minio go sdk PresignedPutObject API for me to make it.
I think the feature may be very fantastic.
Thanks for any suggestions or answers.
The text was updated successfully, but these errors were encountered: