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

SignatureError when :Key starts with a slash #53

Closed
dchelimsky opened this issue Feb 2, 2019 · 0 comments
Closed

SignatureError when :Key starts with a slash #53

dchelimsky opened this issue Feb 2, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@dchelimsky
Copy link
Contributor

> (aws/invoke s3
              {:op      :GetObject
               :request {:Bucket bucket-name
                         :Key    "/path/to/a/file.txt"}})

{:cognitect.anomalies/category :cognitect.anomalies/forbidden
 :Error
 {:Message
  "The request signature we calculated does not match the signature you provided. Check your key and signing method."}}

This is happening because the URI is being generated with a double slash:

> (-> *1 meta :http-request :uri)
"/cognitect-aws-test-1547841641//path/to/a/file.txt"

More context:

The AWS Docs say:

To get an object from such a logical hierarchy, specify the full key name for the object in the GET operation. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg, specify the resource as /photos/2006/February/sample.jpg. For a path-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket, specify the resource as /examplebucket/photos/2006/February/sample.jpg

aws-api users don't know (or need to know) whether the client is building a path-style or virtual-hosted-style request, and in either case, the docs indicate that the :Key param should start with a "/". aws-api should ensure that it doesn't produce "//" in the path part of the uri.

@dchelimsky dchelimsky added the bug Something isn't working label Feb 2, 2019
scottbale pushed a commit that referenced this issue Dec 23, 2024
…53)

If running on JDK 21+, use virtual thread executor in HttpClient.

This should scale better in highly parallel scenarios than the default unbounded newCachedThreadPool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant