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

Allowed asterisk character in the request body #11

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

Conversation

OlegChuev
Copy link

@OlegChuev OlegChuev commented Jan 14, 2025

There is a known issue with sending requests to CloudStack where the asterisk * character is not handled properly by the ACS:
apache/cloudstack-cloudmonkey#154

If you have API calls which contain * (asterisk) characters, you will need to add the option “safe = ‘’” for the URL encoding. The reason is that Python’s urllib will encode * characters by default, while CloudStack’s internal encoder does not encode them; this results in an authentication failure for your API call. In the above you would replace “urllib.quote_plus(request[k])” with “urllib.quote_plus(request[k], safe=’’)”.

Footprints:
https://docs.cloudstack.apache.org/projects/archived-cloudstack-getting-started/en/latest/dev.html

The CGI.escape does not have a safe parameter, causing the * character to be correctly encoded (into %2A), but this value isn't parsed correctly on the ACS side. This results in the error "Status 401: unable to verify user credentials and/or request signature" when body contains * character

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.

1 participant