Uh oh!
There was an error while loading. Please reload this page.
Address reviewers from abandoned PR #1597. - #3091
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
8de4362 to
58a7a6aCompare58a7a6a to
fd3945bComparerafaelweingartner
commented
Dec 12, 2018
@blueorangutan package |
blueorangutan
commented
Dec 12, 2018
@rafaelweingartner a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Dec 12, 2018
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2487 |
| private static final String TOKEN = "token"; | ||
| public static Map<String, String> getQueryMap(String query) { | ||
| String[] params = query.split("&"); |
There was a problem hiding this comment.
Is there a way to parse URL (possibly a get request) to get the key/value map of params?
There was a problem hiding this comment.
Yes, there is, thanks for pointing that!
I will ping you when update it (also extracting some lines to methods, bringing some test cases, and documenting).
yadvr
commented
Jan 3, 2019
@GabrielBrascher you can now package and kick tests yourself to help you with your 4.12 RM work |
blueorangutan
commented
Jan 3, 2019
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Jan 3, 2019
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2512 |
yadvr
commented
Jan 3, 2019
@blueorangutan test |
blueorangutan
commented
Jan 3, 2019
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
GabrielBrascher
commented
Jan 3, 2019
Thanks, @rhtyd! I am going to update this PR soon, addressing your review, just missing a few test cases. |
blueorangutan
commented
Jan 4, 2019
Trillian test result (tid-3296)
|
| for (String param : params) { | ||
| String[] paramTokens = param.split("="); | ||
| String[] paramTokens = param.split(EQUALS); | ||
| if (paramTokens != null && paramTokens.length == 2) { |
There was a problem hiding this comment.
@GabrielBrascher can you change this line to this "If (ArrayUtils.isNotEmpty(paramTokens) && paramTokens.length == 2)"?
| public static Map<String, String> getQueryMap(String query) { | ||
| String[] params = query.split("&"); | ||
| String[] params = query.split(AND); | ||
| Map<String, String> map = new HashMap<String, String>(); |
There was a problem hiding this comment.
This variable should be named "tokenMap" or something similar to show that it should only store a token key-value item.
This will save computation by getting rid of the guardUserInput(map) call in Line #59
| String value = param.split("=")[1]; | ||
| String name = paramTokens[0]; | ||
| String value = paramTokens[1]; | ||
| map.put(name, value); |
There was a problem hiding this comment.
I think another "if n(name.equalsIgnoreCase(TOKEN)" is needed here considering that the map should only contain a "TOKEN" key. and then remove "guardUserInput(map)" call in line 59
| s_logger.error("Unable to decode token"); | ||
| s_logger.error("Unable to decode token due to null console proxy client param"); | ||
| } | ||
| } else { |
There was a problem hiding this comment.
This else statement seems redundant and can go if the tokenMap only contains 1 TOKEN item
dhlaluku
left a comment
There was a problem hiding this comment.
@GabrielBrascher overall nice code refactoring. I left some suggestions for further code refactors
GabrielBrascher
commented
Jan 15, 2019
Thanks, @dhlaluku! I appreciate the review and I will ping you when updating the code. |
yadvr
commented
May 27, 2019
ping @GabrielBrascher is this PR abandoned or you still plan to submit changes? |
GabrielBrascher
commented
May 27, 2019
@rhtyd thanks for pinging, I will take a look at this PR. |
yadvr
commented
Jun 24, 2019
ping @GabrielBrascher |
GabrielBrascher
commented
Jun 24, 2019
Thanks for pointing this PR @rhtyd. I am removing the 4.13.0.0 milestone as it is not critical, I will get back on this one on the future. |
andrijapanicsb
commented
Jan 3, 2020
ping @GabrielBrascher any plans with this one, or should we move it to 4.15 milestone? |
GabrielBrascher
commented
Jan 3, 2020
@andrijapanicsb I will close this one for now. I shall get back to it when having some free time. |
Description
This PR addresses reviewers from PR #1597. If approved we can then close PR #1597.
Fixes: #1597
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?