[GitHub] guacamole-server pull request #167: GUACAMOLE-565: Add terminal-type paramet...

2018-05-17 Thread necouchman
Github user necouchman commented on a diff in the pull request:

https://github.com/apache/guacamole-server/pull/167#discussion_r188934035
  
--- Diff: src/protocols/telnet/settings.c ---
@@ -181,6 +182,12 @@ enum TELNET_ARGS_IDX {
  */
 IDX_BACKSPACE,
 
+/**
+ * The terminal emulator type that is passed to programs (e.g. "xterm" 
or
--- End diff --

Same thing as noted above.


---


[GitHub] guacamole-client pull request #280: GUACAMOLE-152: Allow zoom/scale to be ma...

2018-05-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/guacamole-client/pull/280


---


[GitHub] guacamole-client pull request #181: GUACAMOLE-38: Implement on-demand connec...

2018-05-17 Thread mike-jumper
Github user mike-jumper commented on a diff in the pull request:

https://github.com/apache/guacamole-client/pull/181#discussion_r189082729
  
--- Diff: 
extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
 ---
@@ -184,6 +184,43 @@ public static GuacamoleConfiguration 
getConfiguration(String uri)
 return parameters;
 }
 
+/**
+ * Parse the given string for username and password values,
+ * and return a map containing the username, password
+ * or both.
+ *
+ * @param userInfo
+ * The string to parse for username/password values.
+ * 
+ * @return
+ * A map with the username, password, or both.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+public static Map parseUserInfo(String userInfo)
+throws UnsupportedEncodingException {
+
+Map userInfoMap = new HashMap();
+Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
+
+if (userinfoMatcher.matches()) {
+String username = URLDecoder.decode(
+userinfoMatcher.group(USERNAME_GROUP), "UTF-8");
+String password = URLDecoder.decode(
+userinfoMatcher.group(PASSWORD_GROUP), "UTF-8");
+
+if (username != null && !username.isEmpty())
+userInfoMap.put("username", username);
+
+if (password != null && !password.isEmpty())
+userInfoMap.put("password", password);
--- End diff --

We shouldn't be using a `Map` as a sort of poor man's object. If we need to 
return a username/password pair, then we should either have an object which 
represents a username/password pair, or this function should just set the 
username/password on the `GuacamoleConfiguration` directly (might be easier).


---


[GitHub] guacamole-client pull request #181: GUACAMOLE-38: Implement on-demand connec...

2018-05-17 Thread necouchman
Github user necouchman commented on a diff in the pull request:

https://github.com/apache/guacamole-client/pull/181#discussion_r189133551
  
--- Diff: 
extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
 ---
@@ -184,6 +184,43 @@ public static GuacamoleConfiguration 
getConfiguration(String uri)
 return parameters;
 }
 
+/**
+ * Parse the given string for username and password values,
+ * and return a map containing the username, password
+ * or both.
+ *
+ * @param userInfo
+ * The string to parse for username/password values.
+ * 
+ * @return
+ * A map with the username, password, or both.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+public static Map parseUserInfo(String userInfo)
+throws UnsupportedEncodingException {
+
+Map userInfoMap = new HashMap();
+Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
+
+if (userinfoMatcher.matches()) {
+String username = URLDecoder.decode(
+userinfoMatcher.group(USERNAME_GROUP), "UTF-8");
+String password = URLDecoder.decode(
+userinfoMatcher.group(PASSWORD_GROUP), "UTF-8");
+
+if (username != null && !username.isEmpty())
--- End diff --

Okay, moved the null check to prior to decoding it, so that should be 
solved.


---


[GitHub] guacamole-client pull request #181: GUACAMOLE-38: Implement on-demand connec...

2018-05-17 Thread necouchman
Github user necouchman commented on a diff in the pull request:

https://github.com/apache/guacamole-client/pull/181#discussion_r189133734
  
--- Diff: 
extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java
 ---
@@ -184,6 +184,43 @@ public static GuacamoleConfiguration 
getConfiguration(String uri)
 return parameters;
 }
 
+/**
+ * Parse the given string for username and password values,
+ * and return a map containing the username, password
+ * or both.
+ *
+ * @param userInfo
+ * The string to parse for username/password values.
+ * 
+ * @return
+ * A map with the username, password, or both.
+ *
+ * @throws UnsupportedEncodingException
+ * If Java lacks UTF-8 support.
+ */
+public static Map parseUserInfo(String userInfo)
+throws UnsupportedEncodingException {
+
+Map userInfoMap = new HashMap();
+Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
+
+if (userinfoMatcher.matches()) {
+String username = URLDecoder.decode(
+userinfoMatcher.group(USERNAME_GROUP), "UTF-8");
+String password = URLDecoder.decode(
+userinfoMatcher.group(PASSWORD_GROUP), "UTF-8");
+
+if (username != null && !username.isEmpty())
+userInfoMap.put("username", username);
+
+if (password != null && !password.isEmpty())
+userInfoMap.put("password", password);
--- End diff --

Okay, passed the config object through to the method and just set it 
directly.


---