You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by kr...@apache.org on 2018/10/20 01:49:42 UTC

knox git commit: KNOX-1011 - Add ldap.port system property to configure LDAP demo server port (Attila Csoma via Kevin Risden)

Repository: knox
Updated Branches:
  refs/heads/master 4f606a130 -> 4548f1830


KNOX-1011 - Add ldap.port system property to configure LDAP demo server port (Attila Csoma via Kevin Risden)

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


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

Branch: refs/heads/master
Commit: 4548f18300a5c2b9bffd6a76e77238732c5fcb8b
Parents: 4f606a1
Author: Kevin Risden <kr...@apache.org>
Authored: Fri Oct 19 17:09:58 2018 -0400
Committer: Kevin Risden <kr...@apache.org>
Committed: Fri Oct 19 21:49:17 2018 -0400

----------------------------------------------------------------------
 .../knox/gateway/security/ldap/SimpleLdapDirectoryServer.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/4548f183/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
----------------------------------------------------------------------
diff --git a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
index 5245104..724cb0c 100644
--- a/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
+++ b/gateway-demo-ldap/src/main/java/org/apache/knox/gateway/security/ldap/SimpleLdapDirectoryServer.java
@@ -46,6 +46,8 @@ public class SimpleLdapDirectoryServer {
 
   private static final Logger LOG = LoggerFactory.getLogger(SimpleLdapDirectoryServer.class);
 
+  private static final String DEFAULT_PORT = "33389";
+
   private DirectoryService service;
 
   private LdapServer server;
@@ -144,7 +146,7 @@ public class SimpleLdapDirectoryServer {
       throw new FileNotFoundException( file.getAbsolutePath() );
     }
 
-    int port = 33389;
+    int port = Integer.parseInt(System.getProperty("ldap.port", DEFAULT_PORT));
 
     // Make sure the port is free.
     ServerSocket socket = new ServerSocket( port );