This repository was archived by the owner on Apr 24, 2024. It is now read-only.
Add note in dev.rst about use of the safe option in urllib.quote_plus()#17
Merged
rafaelweingartner merged 1 commit intoapache:masterfrom Apr 24, 2018
Merged
Conversation
Member
|
LGTM, I tested this against ACS 4.5 whenever an API arg (of type string) has an asterisk between text (something like arg="some*value"). When @phillipkent originally opened the issue I could not reproduce this at the time, but I could reproduce this recently. |
Member
|
I've also find this to be an issue with Marvin, and the same fix works with Marvin as well. I'll be send that PR soon. |
Contributor
Author
|
@bhaisaab Just to clarify, the problem isn't when * is between other characters, it is a * anywhere in the request URL which will lead to disagreement of the signatures when CS attempts to validate the incoming API request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a mismatch between the URL encoding behavior of Python and CloudStack's internal URL encoder (Java URLEncoder): Python encodes * (asterisk) characters, while Java does not. When an API call contains a * character, an authentication failure will occur because the computed signatures will not agree.
The solution is to add the option "safe = '*'" to Python's urllib.quote_plus().
NOTE: I can only test this problem on CloudStack version 4.3.2 and I don't have access to later versions where the behavior might be different. But the issue was confirmed by @bhaisaab for Cloudmonkey (see apache/cloudstack-cloudmonkey#11).