Conversation
urllib.quote_plus() requires the option safe="*" (that is, the * character is not encoded) to be consistent with CloudStack's internal encoder/decoder. Without this, API calls containing the * character will fail API authentication.
|
@phillipkent can you share examples of API/cloudmonkey commands where we would like to use * in the args? With this http request without this fix:
This is the request with the fix: In both cases, username gets encoded as %2A which looks alright to me. |
|
@bhaisaab The commands that I tested were to set or modify the displaytext/displayname for a network or virtual machine, such as " update network id=xxxxx displaytext='test*' " . I need to try your example and check that I understand what is going on. I do accept that * is not a very likely symbol to use in a description, however it should work with breaking anything. |
|
@phillipkent I understand, but looks like it still works without your fix. I was able to update network display test with a * in it: Update API: 2016-01-11 17:10:09,300 - requester.py:49 - [DEBUG] ======== START Request ======== List API to verify: 2016-01-11 17:10:24,671 - requester.py:49 - [DEBUG] ======== START Request ======== |
|
@bhaisaab I tested a clean virtualenv install of Cloudmonkey 5.3.2 (from PyPy) and also a clone of the latest Cloudmonkey from github (Python version is 2.7.6). Both of those give me authentication failure when passing a '*' in the command string. The endpoint I am testing is CloudPlatform 4.3.2 (with customisations). Can it be an issue for v4.3.2 but not in later version? I will investigate further and try to diagnose. |
|
I've tried the update network API with ACS 4.5.2 and 4.7.0 and it works for me, so it could be a 4.3.2 related limitation. In that case, we can have this fix though in the request/response logged it made no difference with/without this fix irrespective of the ACS version (as logged in previous comments). |
|
@phillipkent I hit this issue today, while passing an argument. this worked for me. |
Update requester.pyurllib.quote_plus() requires the option safe="*" (that is, the * character is not encoded) to be consistent with CloudStack's internal encoder/decoder. Without this, API calls containing the * character will fail API authentication. * pr/11: Update requester.py Signed-off-by: Rohit Yadav <[email protected]>
|
@bhaisaab : Thanks! |
urllib.quote_plus() requires the option safe="*" (that is, the * character is not encoded) to be consistent with CloudStack's internal encoder/decoder. Without this, API calls containing the * character will fail API authentication.