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

Sort query parameters according to spec #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fiddlerwoaroof
Copy link

AWS requests were failing in certain cases, the spec for canonicalizing the query string says:

Sort the parameter names by character code point in ascending order

This PR sorts only the names and not the name+value, which made the failing requests work. (e.g. use fukamachi's aws-sdk-lisp project to list all stacks and specify more than 9 statuses in the :stack-status-filter

@fiddlerwoaroof
Copy link
Author

I guess I need to finish the tests...

@bakketun
Copy link
Member

The documentation says that query parameters should only be sorted by names, but the test suite does indeed have a test expecting the values to be used for sorting too. See get-vanilla-query-order-value. I've updated to the latest version of the test suite. That test is still there.

I suspect the problem with aws-sdk-lisp is something else. I was not able to load :aws-sdk/services/cloudformation (got error: no symbol named "INCLUDE-EMPTY-SECTIONS?" in "PARSER.INI"). Do you have an example of what parameters create-canonical-request is called with?

@fiddlerwoaroof
Copy link
Author

fiddlerwoaroof commented Jun 25, 2018

Here's an example without my fix applied:

(AWS-SIGN4:CREATE-CANONICAL-REQUEST
 :POST "/"
 "Action=ListStacks&StackStatusFilter.member.1=UPDATE_COMPLETE&StackStatusFilter.member.10=CREATE_IN_PROGRESS&StackStatusFilter.member.11=DELETE_IN_PROGRESS&StackStatusFilter.member.12=DELETE_FAILED&StackStatusFilter.member.2=UPDATE_IN_PROGRESS&StackStatusFilter.member.3=UPDATE_COMPLETE_CLEANUP_IN_PROGRESS&StackStatusFilter.member.4=UPDATE_ROLLBACK_COMPLETE&StackStatusFilter.member.5=UPDATE_ROLLBACK_IN_PROGRESS&StackStatusFilter.member.6=UPDATE_ROLLBACK_FAILED&StackStatusFilter.member.7=UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS&StackStatusFilter.member.8=CREATE_FAILED&StackStatusFilter.member.9=CREATE_COMPLETE"
 '(("host" "cloudformation.us-west-2.amazonaws.com")
   ("x-amz-date" "20180625T190057Z"))
 "host;x-amz-date"
 "")```

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

Successfully merging this pull request may close these issues.

None yet

2 participants