-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
aws-sigv4 does not work with URLs containing "=" and other special characters #13754
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
Comments
Note, I've also tried to quote the path manually, e.g. using |
/cc @outscale-mgo |
I refactor canon_query, so I could use the encoding part of the function to use it in the path. As the path doesn't encode '/', but encode '=', I had to add some conditions to know If I was doing the query or path encoding. Also, instead of adding a `bool in_path` variable, I use `bool *found_equals` to know if the function was called for the query or path, as found_equals is used only in query_encoding. fix: curl#13754 Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
Thank you! Confirmed master branch works for me. |
Probably the Known Bugs page needs an update. The old bug is still listed: https://curl.se/docs/knownbugs.html#aws_sigv4_does_not_sign_requests |
Since #13754 Pointed-out-by: Slaven Rezić Bug: #13754 (comment)
Since #13754 Pointed-out-by: Slaven Rezić Bug: #13754 (comment) Closes #14392
I did this
I'm trying to use --aws-sigv4 to download S3 objects containing "=" in their key. Example
data/asset_id=my-asset/dt=2024-05-22/data.parquet
- this is called hive partitioning scheme and is popular in data lakes.Here's how I call it:
Curl 8.8 returns the following error (formatted for readability):
Note that the path in CanonicalRequest is supposed to be quoted ("=" changed to "%3D"), whereas curl is not quoting it (confirmed by debug tracing). AWS docs say we need to apply their special URIEncode function to all the components of the canonical request.
I've created a basic patch to see if this is the actual problem and after applying it, the signature is accepted by AWS S3:
This seems similar to a known problem 16.1 aws-sigv4 does not sign requests with * correctly. I see that there was a PR to fix it, but it's now dead.
My intent with creating this issue is 1) to say that the scope of the bug is not limited to "*", but applies to any URL with any characters except alphanumeric and
-
,.
,_
and~
, 2) hopefully resurrect the push to fix it.I expected the following
The command above should work as-is.
curl/libcurl version
curl 8.8.0 (x86_64-pc-linux-gnu) libcurl/8.8.0 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 c-ares/1.28.1 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 nghttp3/1.3.0
Release-Date: 2024-05-22
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Largefile libz NTLM PSL SSL threadsafe TLS-SRP TrackMemory UnixSockets zstd
operating system
Linux 5.15.0-1058-aws #64~20.04.1-Ubuntu SMP Tue Apr 9 11:12:27 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: