-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Query string sorting in canonicalisation #1031
base: main
Are you sure you want to change the base?
Query string sorting in canonicalisation #1031
Conversation
@nitinprakash96 I should also say, S3 Select is not being offered to new customers, so while I no longer get the signing error, I do get this:
I cannot test further, so please let me know if it works for you. |
e1aeafd
to
fd01689
Compare
The "canonical requests" used in AWS signing require query parameters to be sorted by key. In rare cases, sorting by joined `key=value` can create invalid canonical requests. Example: S3 Select wants to canonicalise a query string of `select&select-type=2`. `select=` sorts after `select-type=2` because `-` sorts before `=`. But we need to sort `select` first.
fd01689
to
23343f5
Compare
Thanks for looking into this @endgame . Appreciate it. I can test it out over the weekend if you don't mind. |
@nitinprakash96 I'd appreciate that a lot. All I can do is check that signature verification passes, but I can't tell whether S3 Select actually works now. |
While the signature issue is resolved by this error, I run into the following exception:
But I'm not sure if this is due to this PR or the calling code is incorrect. I'm using the same snippet as described in the corresponding issue. |
@nitinprakash96 please check if this works for you.
This PR fixes the ordering of query parameters during request signing. They should now sort correctly in all instances. Although I've added tests, I really don't want to break anything here. If you use Amazonka with an API that uses query parameters in its request format (potentially: IAM, SNS, SimpleDB, CloudWatch, SES, RDS, STS, Elastic Load Balancing (v1 or v2), SQS, DocumentDB, CloudSearch, Redshift, Application Auto Scaling, CloudFormation, Neptune, Elasticache (control plane), Elastic Beanstalk, or Import/Export), I'd love to hear from you.
Fixes #965