You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/10/17 17:21:33 UTC

[1/3] guacamole-client git commit: GUACAMOLE-524: Correct handling of tokens within SimpleConnection. The copy of the configuration should be filtered, not the original, and token values need to actually be set.

Repository: guacamole-client
Updated Branches:
  refs/heads/master f3cbdf5a3 -> ecca7bc50


GUACAMOLE-524: Correct handling of tokens within SimpleConnection. The copy of the configuration should be filtered, not the original, and token values need to actually be set.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/143c10b6
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/143c10b6
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/143c10b6

Branch: refs/heads/master
Commit: 143c10b6efb42a6bccd95714795d0c6ab0a06be1
Parents: 333a8c4
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Oct 16 13:23:55 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Oct 16 14:53:10 2018 -0700

----------------------------------------------------------------------
 .../org/apache/guacamole/net/auth/simple/SimpleConnection.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/143c10b6/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java
----------------------------------------------------------------------
diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java
index f9da240..2dec26a 100644
--- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java
+++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java
@@ -113,8 +113,7 @@ public class SimpleConnection extends AbstractConnection {
 
         // Apply tokens to config parameters
         GuacamoleConfiguration filteredConfig = new GuacamoleConfiguration(config);
-        TokenFilter tokenFilter = new TokenFilter();
-        tokenFilter.filterValues(config.getParameters());
+        new TokenFilter(tokens).filterValues(filteredConfig.getParameters());
 
         GuacamoleSocket socket;
 


[2/3] guacamole-client git commit: GUACAMOLE-524: Provide convenience constructor for TokenFilter which initializes the filter with provided tokens.

Posted by vn...@apache.org.
GUACAMOLE-524: Provide convenience constructor for TokenFilter which initializes the filter with provided tokens.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/333a8c41
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/333a8c41
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/333a8c41

Branch: refs/heads/master
Commit: 333a8c411f90f847f50111939089f3d10610ed89
Parents: f3cbdf5
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Oct 16 13:21:57 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Oct 16 14:53:10 2018 -0700

----------------------------------------------------------------------
 .../org/apache/guacamole/token/TokenFilter.java | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/333a8c41/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java
----------------------------------------------------------------------
diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java b/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java
index ab43622..c412d18 100644
--- a/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java
+++ b/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java
@@ -19,6 +19,7 @@
 
 package org.apache.guacamole.token;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -68,7 +69,27 @@ public class TokenFilter {
     /**
      * The values of all known tokens.
      */
-    private final Map<String, String> tokenValues = new HashMap<String, String>();
+    private final Map<String, String> tokenValues;
+
+    /**
+     * Creates a new TokenFilter which has no associated tokens. Tokens must
+     * later be given using {@link #setToken(java.lang.String, java.lang.String)}
+     * or {@link #setTokens(java.util.Map)}.
+     */
+    public TokenFilter() {
+         this(Collections.<String, String>emptyMap());
+    }
+
+    /**
+     * Creates a new TokenFilter which is initialized with the given token
+     * name/value pairs.
+     *
+     * @param tokenValues
+     *     A map containing token names and their corresponding values.
+     */
+    public TokenFilter(Map<String, String> tokenValues) {
+        this.tokenValues = new HashMap<>(tokenValues);
+    }
 
     /**
      * Sets the token having the given name to the given value. Any existing


[3/3] guacamole-client git commit: GUACAMOLE-524: Merge correct handling of parameter tokens within SimpleConnection

Posted by vn...@apache.org.
GUACAMOLE-524: Merge correct handling of parameter tokens within SimpleConnection


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/ecca7bc5
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/ecca7bc5
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/ecca7bc5

Branch: refs/heads/master
Commit: ecca7bc509ebc4c2ff9ee6db3ee2caf73e60a8fb
Parents: f3cbdf5 143c10b
Author: Nick Couchman <vn...@apache.org>
Authored: Wed Oct 17 13:20:44 2018 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Wed Oct 17 13:20:44 2018 -0400

----------------------------------------------------------------------
 .../net/auth/simple/SimpleConnection.java       |  3 +--
 .../org/apache/guacamole/token/TokenFilter.java | 23 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------