Skip to content
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

put Bucket Versioning API returning Signature Error #11

Open
pavo-tusker opened this issue Aug 3, 2020 · 0 comments
Open

put Bucket Versioning API returning Signature Error #11

pavo-tusker opened this issue Aug 3, 2020 · 0 comments

Comments

@pavo-tusker
Copy link

We tried to use the put_bucket_versioning API but we cannot make it work.
We are using SigAWS library in elixir for a signature generation

Here I provide my code and response:
` url = "http://localhost:9000/test-2/?versioning"

body = Poison.encode!(%{
VersioningConfiguration: %{
Status: "Enabled"
}
})

{:ok, %{} = sig_data, _} =
Sigaws.sign_req(url, service: "s3",
method: "PUT",
access_key: "minioadmin",
secret: "minioadmin" )
response = HTTPoison.put(url, body, sig_data, [])`
Our Signature:

%{ "Authorization" => "AWS4-HMAC-SHA256 Credential=minioadmin/20200803/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-date, Signature=8ebe222447092a680ec23b5a39a9a23c7534f553532c1d3795f02cae8edd94cc", "X-Amz-Algorithm" => "AWS4-HMAC-SHA256", "X-Amz-Content-Sha256" => "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "X-Amz-Date" => "20200803T123312Z", "X-Amz-SignedHeaders" => "host;x-amz-date" }

The response we are getting from Minio:
{:ok, %HTTPoison.Response{ body: "\nXAmzContentSHA256MismatchThe provided 'x-amz-content-sha256' header does not match what was computed.test-2/test-2/1627C21608F0480A628b08f3-7ffe-442d-bf96-20083da98366", headers: [ {"Accept-Ranges", "bytes"}, {"Content-Length", "347"}, {"Content-Security-Policy", "block-all-mixed-content"}, {"Content-Type", "application/xml"}, {"Server", "MinIO/RELEASE.2020-07-27T18-37-02Z"}, {"Vary", "Origin"}, {"X-Amz-Request-Id", "1627C21608F0480A"}, {"X-Xss-Protection", "1; mode=block"}, {"Date", "Mon, 03 Aug 2020 12:33:12 GMT"} ], request: %HTTPoison.Request{ body: "{"VersioningConfiguration":{"Status":"Enabled"}}", headers: [ {"Authorization", "AWS4-HMAC-SHA256 Credential=minioadmin/20200803/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-date, Signature=8ebe222447092a680ec23b5a39a9a23c7534f553532c1d3795f02cae8edd94cc"}, {"X-Amz-Algorithm", "AWS4-HMAC-SHA256"}, {"X-Amz-Content-Sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, {"X-Amz-Date", "20200803T123312Z"}, {"X-Amz-SignedHeaders", "host;x-amz-date"} ], method: :put, options: [], params: %{}, url: "http://localhost:9000/test-2/?versioning" }, request_url: "http://localhost:9000/test-2/?versioning", status_code: 400 }}

Looks like the sigAws library generating the wrong signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant