Github user wilderrodrigues commented on the pull request:
https://github.com/apache/cloudstack/pull/615#issuecomment-123766531
Hi guys,
1. RegisterSSHKeyPairCmd.getPublicKey() doesn't do a decoding of the key.
That's just a simple getter method.
2. However, I don't think the addition of the URLDecoder for the public key
is really necessary.
I have seen the use of URLDecoder for the cypher text, an URL or form data,
but not the pub-key itself being decoded using W3C.
""" Decodes a application/x-www-form-urlencoded string using a specific
encoding scheme. The supplied encoding is used to determine what characters are
represented by any consecutive sequences of the form "%xy".
Note: The World Wide Web Consortium Recommendation states that UTF-8 should
be used. Not doing so may introduce incompatibilities."""
@DaanHoogland, is it being done because the data is coming via the API,
which is a web based? If so, it does make sense.
@borisroman: in order to make Java compatible with the RFC-3986, we need to
do something like:
* To comply with RFC-3986.
* URLEncoder.encode(original, "UTF-8").replace("+", "%20").replace("*",
"%2A").replace("%7E", "~");
Perhaps finding where the pub-key gets decoded before the the code Daan
added is better than just removing it.
In addition, could you let me know which steps you followed to test it? I
would like to help verifying.
Cheers,
Wilder
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---