knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject knox git commit: KNOX-1577 - Knox automatically derived dispatch whitelist doesn't seem to actually match the knox domain
Date Wed, 14 Nov 2018 14:52:59 GMT
Repository: knox
Updated Branches:
  refs/heads/v1.2.0 50b08280a -> 5be3f1a64


KNOX-1577 - Knox automatically derived dispatch whitelist doesn't seem to actually match the
knox domain

Signed-off-by: Kevin Risden <krisden@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/5be3f1a6
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/5be3f1a6
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/5be3f1a6

Branch: refs/heads/v1.2.0
Commit: 5be3f1a64d9cf2851d99a690198f6787626d9ed3
Parents: 50b0828
Author: pzampino <pzampino@gmail.com>
Authored: Fri Nov 9 14:11:22 2018 -0500
Committer: Kevin Risden <krisden@apache.org>
Committed: Wed Nov 14 09:52:47 2018 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/knox/gateway/util/WhitelistUtils.java    | 2 +-
 .../java/org/apache/knox/gateway/util/WhitelistUtilsTest.java     | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/5be3f1a6/gateway-spi/src/main/java/org/apache/knox/gateway/util/WhitelistUtils.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/knox/gateway/util/WhitelistUtils.java b/gateway-spi/src/main/java/org/apache/knox/gateway/util/WhitelistUtils.java
index cc91ffd..09eaefe 100644
--- a/gateway-spi/src/main/java/org/apache/knox/gateway/util/WhitelistUtils.java
+++ b/gateway-spi/src/main/java/org/apache/knox/gateway/util/WhitelistUtils.java
@@ -34,7 +34,7 @@ public class WhitelistUtils {
 
   static final String LOCALHOST_REGEXP = "^" + LOCALHOST_REGEXP_SEGMENT + "$";
 
-  static final String DEFAULT_DISPATCH_WHITELIST_TEMPLATE = "^/.*$;^https?://%s:[0-9]+/?.*$";
+  static final String DEFAULT_DISPATCH_WHITELIST_TEMPLATE = "^\\/.*$;^https?:\\/\\/%s:[0-9]+\\/?.*$";
 
   private static final String IP_ADDRESS_REGEX = "^(?:[0-9]{1,3}\\.){3}[0-9]{1,3}$";
 

http://git-wip-us.apache.org/repos/asf/knox/blob/5be3f1a6/gateway-spi/src/test/java/org/apache/knox/gateway/util/WhitelistUtilsTest.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/test/java/org/apache/knox/gateway/util/WhitelistUtilsTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/util/WhitelistUtilsTest.java
index de95fa8..dc50588 100644
--- a/gateway-spi/src/test/java/org/apache/knox/gateway/util/WhitelistUtilsTest.java
+++ b/gateway-spi/src/test/java/org/apache/knox/gateway/util/WhitelistUtilsTest.java
@@ -28,6 +28,7 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -79,7 +80,7 @@ public class WhitelistUtilsTest {
                                            "host0.test.org",
                                            serviceRole);
     assertNotNull(whitelist);
-    assertTrue(whitelist.contains("\\.test\\.org"));
+    assertEquals("^\\/.*$;^https?:\\/\\/(.+\\.test\\.org):[0-9]+\\/?.*$", whitelist); //
KNOX-1577
   }
 
   @Test


Mime
View raw message