This is an automated email from the ASF dual-hosted git repository.

lmccay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 9dd514860 KNOX-3108: Append classpath with additional paths (#1004) 
via hanicz
9dd514860 is described below

commit 9dd514860ff6a79e81ccead91c021a506465cfc6
Author: hanicz <[email protected]>
AuthorDate: Fri Mar 7 15:47:26 2025 +0100

    KNOX-3108: Append classpath with additional paths (#1004) via hanicz
---
 .../src/main/resources/META-INF/launcher.cfg       |   2 +-
 .../launcher/GatewayServerClasspathExtender.java   |  55 ++++--
 .../GatewayServerClasspathExtenderTest.java        | 152 ++++++++-------
 .../src/test/resources/gateway-site-test.xml       | 210 ---------------------
 4 files changed, 129 insertions(+), 290 deletions(-)

diff --git a/gateway-server-launcher/src/main/resources/META-INF/launcher.cfg 
b/gateway-server-launcher/src/main/resources/META-INF/launcher.cfg
index 5a0c262d9..3554a23da 100644
--- a/gateway-server-launcher/src/main/resources/META-INF/launcher.cfg
+++ b/gateway-server-launcher/src/main/resources/META-INF/launcher.cfg
@@ -13,6 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 main.class = org.apache.knox.gateway.GatewayServer
-class.path = 
../conf;../lib/*.jar;../dep/*.jar;../ext;../ext/*.jar;/usr/share/java/*.jar
+class.path = ../conf;../lib/*.jar;../dep/*.jar;../ext;../ext/*.jar
 GATEWAY_HOME=${launcher.dir}/..
 log4j.configurationFile=${GATEWAY_HOME}/conf/${launcher.name}-log4j2.xml
diff --git 
a/gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtender.java
 
b/gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtender.java
index caae4f530..3ea56891a 100644
--- 
a/gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtender.java
+++ 
b/gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtender.java
@@ -30,8 +30,10 @@ import java.util.regex.Pattern;
 
 public class GatewayServerClasspathExtender {
 
-    private static final String CLASSPATH_EXTENSION_PROPERTY = 
"gateway.server.classpath.extension";
-    private static final String CLASSPATH_PROPERTY_PATTERN = 
"<property>\\s*<name>" + CLASSPATH_EXTENSION_PROPERTY + 
"</name>\\s*<value>(.*?)</value>\\s*</property>";
+    private static final String CLASSPATH_PREPEND_PROPERTY = 
"gateway.server.prepend.classpath";
+    private static final String CLASSPATH_APPEND_PROPERTY = 
"gateway.server.append.classpath";
+    private static final String CLASSPATH_PREPEND_PROPERTY_PATTERN = 
"<property>\\s*<name>" + CLASSPATH_PREPEND_PROPERTY + 
"</name>\\s*<value>(.*?)</value>\\s*</property>";
+    private static final String CLASSPATH_APPEND_PROPERTY_PATTERN = 
"<property>\\s*<name>" + CLASSPATH_APPEND_PROPERTY + 
"</name>\\s*<value>(.*?)</value>\\s*</property>";
     private static final String CONFIG_FILE = "gateway-site.xml";
     private static final String CONFIG_PATH = "../conf/" + CONFIG_FILE;
     private static final String CLASS_PATH_PROPERTY = "class.path";
@@ -40,7 +42,8 @@ public class GatewayServerClasspathExtender {
     private static final String[] CLASS_PATH_DELIMITERS = new String[]{",", 
";"};
 
     private final File base;
-    private final Pattern pattern = 
Pattern.compile(CLASSPATH_PROPERTY_PATTERN, Pattern.DOTALL);
+    private final Pattern prependPattern = 
Pattern.compile(CLASSPATH_PREPEND_PROPERTY_PATTERN, Pattern.DOTALL);
+    private final Pattern appendPattern = 
Pattern.compile(CLASSPATH_APPEND_PROPERTY_PATTERN, Pattern.DOTALL);
 
     public GatewayServerClasspathExtender(File base) {
         this.base = base;
@@ -50,26 +53,50 @@ public class GatewayServerClasspathExtender {
         Path configFilePath = Paths.get(base.getPath(), CONFIG_PATH);
         if 
(GATEWAY_SERVER_MAIN_CLASS.equals(properties.getProperty(MAIN_CLASS_PROPERTY)) 
&& Files.isReadable(configFilePath)) {
             String configContent = new 
String(Files.readAllBytes(configFilePath), StandardCharsets.UTF_8);
-            extractExtensionPathIntoProperty(configContent, properties);
+            prependClassPathProperty(configContent, properties);
+            appendClassPathProperty(configContent, properties);
         }
     }
 
-    protected void extractExtensionPathIntoProperty(String configContent, 
Properties properties) {
-        final Matcher matcher = pattern.matcher(configContent);
+    private void prependClassPathProperty(String configContent, Properties 
properties) {
+        String prepend = getPropertyFromConfigFile(prependPattern, 
configContent);
+        if (prepend != null) {
+            StringBuilder newClassPath = new StringBuilder(prepend);
+            if (!endsWithDelimiter(newClassPath.toString())) {
+                newClassPath.append(CLASS_PATH_DELIMITERS[1]);
+            }
+            newClassPath.append(properties.getProperty(CLASS_PATH_PROPERTY));
+            properties.setProperty(CLASS_PATH_PROPERTY, 
newClassPath.toString());
+        }
+    }
 
-        if (matcher.find()) {
-            StringBuilder newClassPath = new 
StringBuilder(matcher.group(1).trim());
-            if (newClassPath.length() > 0) {
-                if (!endsWithDelimiter(newClassPath.toString())) {
-                    newClassPath.append(CLASS_PATH_DELIMITERS[1]);
-                }
-                
newClassPath.append(properties.getProperty(CLASS_PATH_PROPERTY));
-                properties.setProperty(CLASS_PATH_PROPERTY, 
newClassPath.toString());
+    private void appendClassPathProperty(String configContent, Properties 
properties) {
+        String appendage = getPropertyFromConfigFile(appendPattern, 
configContent);
+        if (appendage != null) {
+            StringBuilder newClassPath = new 
StringBuilder(properties.getProperty(CLASS_PATH_PROPERTY));
+            if (!startsWithDelimiter(appendage)) {
+                newClassPath.append(CLASS_PATH_DELIMITERS[1]);
             }
+            newClassPath.append(appendage);
+            properties.setProperty(CLASS_PATH_PROPERTY, 
newClassPath.toString());
         }
     }
 
+    private String getPropertyFromConfigFile(Pattern pattern, String 
configContent) {
+        String property = null;
+        final Matcher matcher = pattern.matcher(configContent);
+        if (matcher.find() && !matcher.group(1).trim().isEmpty()) {
+            property = matcher.group(1).trim();
+        }
+        return property;
+    }
+
     private boolean endsWithDelimiter(String path) {
         return Arrays.stream(CLASS_PATH_DELIMITERS).anyMatch(path::endsWith);
     }
+
+    private boolean startsWithDelimiter(String path) {
+        return Arrays.stream(CLASS_PATH_DELIMITERS).anyMatch(path::startsWith);
+    }
+
 }
diff --git 
a/gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtenderTest.java
 
b/gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtenderTest.java
index 81dfbff82..ea4ab3df8 100644
--- 
a/gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtenderTest.java
+++ 
b/gateway-util-launcher/src/test/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtenderTest.java
@@ -22,7 +22,6 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -53,26 +52,22 @@ public class GatewayServerClasspathExtenderTest {
 
     @Test
     public void extendClassPathPropertyTest() throws IOException {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        properties.setProperty("main.class", 
"org.apache.knox.gateway.GatewayServer");
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
         GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent("/new/classp/*");
+        String configContent = this.getConfigContent("/new/classp/*", 
"/appendage/*");
         Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
         gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("/new/classp/*;classpath", 
properties.getProperty("class.path"));
+        assertEquals("/new/classp/*;classpath;/appendage/*", 
properties.getProperty("class.path"));
     }
 
     @Test
     public void extendClassPathPropertyDifferentMainClassTest() throws 
IOException {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        properties.setProperty("main.class", 
"org.apache.knox.gateway.KnoxCLI");
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.KnoxCLI");
         GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent("/new/classp/*");
+        String configContent = this.getConfigContent("/new/classp/*", 
"/appendage/*");
         Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
         gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
@@ -80,97 +75,124 @@ public class GatewayServerClasspathExtenderTest {
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyNoDelimTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyWithDelimitersTest() throws IOException 
{
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent("/new/classp/*");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = this.getConfigContent("/new/classp/*;", 
";/appendage/*");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("/new/classp/*;classpath", 
properties.getProperty("class.path"));
+        assertEquals("/new/classp/*;classpath;/appendage/*", 
properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyXMLFormatTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyWhitespaceTest() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent("/new/classp/*;");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = this.getConfigContent(" /new/classp/*; ", " 
;/appendage/* ");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("/new/classp/*;classpath", 
properties.getProperty("class.path"));
+        assertEquals("/new/classp/*;classpath;/appendage/*", 
properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyWhitespaceTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyMultipleTest() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent(" /new/classp/*; ");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = 
this.getConfigContent("/new/classp/*,../classp", 
"/appendage/*,/appendage2/*.jar");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("/new/classp/*;classpath", 
properties.getProperty("class.path"));
+        
assertEquals("/new/classp/*,../classp;classpath;/appendage/*,/appendage2/*.jar",
 properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyMultipleTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyEmptyTest() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = 
this.getConfigContent("/new/classp/*,../classp");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = this.getConfigContent("", "");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("/new/classp/*,../classp;classpath", 
properties.getProperty("class.path"));
+        assertEquals("classpath", properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyEmptyTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyEmptyWhitespaceTest() throws 
IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent("");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = this.getConfigContent(" ", " ");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
         assertEquals("classpath", properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyEmptyWhitespaceTest() {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyOnlyPrepend() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
 
-        String configContent = this.getConfigContent(" ");
-        
gatewayServerClasspathExtender.extractExtensionPathIntoProperty(configContent, 
properties);
+        String configContent = 
this.getConfigContent("/new/classp/*,../classp", null);
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        assertEquals("classpath", properties.getProperty("class.path"));
+        assertEquals("/new/classp/*,../classp;classpath", 
properties.getProperty("class.path"));
     }
 
     @Test
-    public void extractExtensionPathIntoPropertyNoConfigTest() throws 
IOException {
-        Properties properties = new Properties();
-        properties.setProperty("class.path", "classpath");
-        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(null);
+    public void extendClassPathPropertyOnlyAppend() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
+
+        String configContent = this.getConfigContent(null, 
"/appendage/*,/appendage2/*.jar");
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
-        ClassLoader classLoader = getClass().getClassLoader();
-        File file = new 
File(classLoader.getResource("gateway-site-test.xml").getFile());
+        assertEquals("classpath;/appendage/*,/appendage2/*.jar", 
properties.getProperty("class.path"));
+    }
 
-        gatewayServerClasspathExtender.extractExtensionPathIntoProperty(new 
String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8), properties);
+    @Test
+    public void extendClassPathPropertyNoExtension() throws IOException {
+        Properties properties = this.getProperties("classpath", 
"org.apache.knox.gateway.GatewayServer");
+        GatewayServerClasspathExtender gatewayServerClasspathExtender = new 
GatewayServerClasspathExtender(confDir.toFile());
+
+        String configContent = this.getConfigContent(null, null);
+        Files.write(configFilePath, 
configContent.getBytes(StandardCharsets.UTF_8));
+        gatewayServerClasspathExtender.extendClassPathProperty(properties);
 
         assertEquals("classpath", properties.getProperty("class.path"));
     }
 
-    private String getConfigContent(String extensionValue) {
-        return "<configuration>\n" +
-                "    <property>\n" +
-                "        <name>gateway.server.classpath.extension</name>\n" +
-                "        <value>" + extensionValue + "</value>\n" +
-                "    </property>\n" +
-                "</configuration>";
+    @SuppressWarnings("PMD.InsufficientStringBufferDeclaration")
+    private String getConfigContent(String prependValue, String appendValue) {
+        StringBuilder content = new StringBuilder("<?xml version=\"1.0\" 
encoding=\"UTF-8\"?><configuration>");
+
+        if(prependValue != null) {
+            
content.append("<configuration><property><name>gateway.server.prepend.classpath</name><value>");
+            content.append(prependValue);
+            content.append("</value></property></configuration>");
+        }
+
+        if(appendValue != null) {
+            
content.append("<configuration><property><name>gateway.server.append.classpath</name><value>");
+            content.append(appendValue);
+            content.append("</value></property></configuration>");
+        }
+        content.append("</configuration>");
+        return content.toString();
+    }
+
+    private Properties getProperties(String classPath, String mainClass) {
+        Properties properties = new Properties();
+        properties.setProperty("class.path", classPath);
+        properties.setProperty("main.class", mainClass);
+        return properties;
     }
 }
diff --git a/gateway-util-launcher/src/test/resources/gateway-site-test.xml 
b/gateway-util-launcher/src/test/resources/gateway-site-test.xml
deleted file mode 100644
index b442e1998..000000000
--- a/gateway-util-launcher/src/test/resources/gateway-site-test.xml
+++ /dev/null
@@ -1,210 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<configuration>
-
-    <property>
-        <name>gateway.service.alias.impl</name>
-        
<value>org.apache.knox.gateway.services.security.impl.RemoteAliasService</value>
-    </property>
-    <property>
-        <name>gateway.port</name>
-        <value>8443</value>
-        <description>The HTTP port for the Gateway.</description>
-    </property>
-
-    <property>
-        <name>gateway.path</name>
-        <value>gateway</value>
-        <description>The default context path for the gateway.</description>
-    </property>
-
-    <property>
-        <name>gateway.gateway.conf.dir</name>
-        <value>deployments</value>
-        <description>The directory within GATEWAY_HOME that contains gateway 
topology files and deployments.</description>
-    </property>
-
-    <property>
-        <name>gateway.hadoop.kerberos.secured</name>
-        <value>false</value>
-        <description>Boolean flag indicating whether the Hadoop cluster 
protected by Gateway is secured with Kerberos</description>
-    </property>
-
-    <property>
-        <name>java.security.krb5.conf</name>
-        <value>/etc/knox/conf/krb5.conf</value>
-        <description>Absolute path to krb5.conf file</description>
-    </property>
-
-    <property>
-        <name>java.security.auth.login.config</name>
-        <value>/etc/knox/conf/krb5JAASLogin.conf</value>
-        <description>Absolute path to JAAS login config file</description>
-    </property>
-
-    <property>
-        <name>sun.security.krb5.debug</name>
-        <value>false</value>
-        <description>Boolean flag indicating whether to enable debug messages 
for krb5 authentication</description>
-    </property>
-
-    <!-- @since 0.10 Websocket configs -->
-    <property>
-        <name>gateway.websocket.feature.enabled</name>
-        <value>false</value>
-        <description>Enable/Disable websocket feature.</description>
-    </property>
-
-    <property>
-        <name>gateway.scope.cookies.feature.enabled</name>
-        <value>false</value>
-        <description>Enable/Disable cookie scoping feature.</description>
-    </property>
-
-    <property>
-        <name>gateway.cluster.config.monitor.ambari.enabled</name>
-        <value>false</value>
-        <description>Enable/disable Ambari cluster configuration 
monitoring.</description>
-    </property>
-
-    <property>
-        <name>gateway.cluster.config.monitor.ambari.interval</name>
-        <value>60</value>
-        <description>The interval (in seconds) for polling Ambari for cluster 
configuration changes.</description>
-    </property>
-    <!-- @since 2.0.0 WebShell configs -->
-    <!-- must have websocket enabled to use webshell --> 
-    <property>
-        <name>gateway.webshell.feature.enabled</name>
-        <value>false</value>
-        <description>Enable/Disable webshell feature.</description>
-    </property>
-    <property>
-        <name>gateway.webshell.max.concurrent.sessions</name>
-        <value>20</value>
-        <description>Maximum number of total concurrent webshell 
sessions</description>
-    </property>
-    <property>
-        <name>gateway.webshell.audit.logging.enabled</name>
-        <value>false</value>
-        <description>[Experimental Feature] Enable/Disable webshell command 
audit logging.
-            NOTE: Turning this on might log secrets that might be part of
-            command line arguments, please consider this before turning this 
on.</description>
-    </property>
-    <property>
-        <name>gateway.webshell.read.buffer.size</name>
-        <value>1024</value>
-        <description>Web Shell buffer size for reading</description>
-    </property>
-
-    <!-- @since 2.0.0 websocket JWT validation configs -->
-    <property>
-        <name>gateway.websocket.JWT.validation.feature.enabled</name>
-        <value>true</value>
-        <description>Enable/Disable websocket JWT validation at websocket 
layer.</description>
-    </property>
-
-    <!-- @since 1.5.0 homepage logout -->
-    <property>
-        <name>knox.homepage.logout.enabled</name>
-        <value>true</value>
-        <description>Enable/disable logout from the Knox 
Homepage.</description>
-    </property>
-
-    <!-- @since 2.1.0 KnoxSSO Cookie Invalidation -->
-    <property>
-        <name>gateway.knox.token.management.users.can.see.all.tokens</name>
-        <value>admin</value>
-        <description>A comma separated list of user names who can see all 
tokens on the Token Management page</description>
-    </property>
-
-    <!-- @since 1.6.0 token management related properties -->
-    <property>
-        <name>gateway.knox.token.eviction.grace.period</name>
-        <value>0</value>
-        <description>A duration (in seconds) beyond a token’s expiration to 
wait before evicting its state. This configuration only applies when 
server-managed token state is enabled either in gateway-site or at the topology 
level.</description>
-    </property>
-
-    <!-- @since 2.1.0 application path aliases -->
-    <property>
-        <name>gateway.application.path.alias.token-generation</name>
-        <value>tokengen</value>
-    </property>
-
-
-    <!-- Knox Admin related config -->
-    <property>
-        <name>gateway.knox.admin.groups</name>
-        <value>admin</value>
-    </property>
-
-    <!-- DEMO LDAP config for Hadoop Group Provider -->
-    <property>
-        <name>gateway.group.config.hadoop.security.group.mapping</name>
-        <value>org.apache.hadoop.security.LdapGroupsMapping</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.bind.user</name>
-        <value>uid=guest,ou=people,dc=hadoop,dc=apache,dc=org</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.bind.password</name>
-        <value>guest-password</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.url</name>
-        <value>ldap://localhost:33389</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.base</name>
-        <value></value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.search.filter.user</name>
-        
<value>(&amp;(|(objectclass=person)(objectclass=applicationProcess))(cn={0}))</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.search.filter.group</name>
-        <value>(objectclass=groupOfNames)</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.search.attr.member</name>
-        <value>member</value>
-    </property>
-    <property>
-        
<name>gateway.group.config.hadoop.security.group.mapping.ldap.search.attr.group.name</name>
-        <value>cn</value>
-    </property>
-    <property>
-        <name>gateway.dispatch.whitelist.services</name>
-        
<value>DATANODE,HBASEUI,HDFSUI,JOBHISTORYUI,NODEUI,YARNUI,knoxauth</value>
-        <description>The comma-delimited list of service roles for which the 
gateway.dispatch.whitelist should be applied.</description>
-    </property>
-    <property>
-        <name>gateway.dispatch.whitelist</name>
-        
<value>^https?:\/\/(localhost|127\.0\.0\.1|0:0:0:0:0:0:0:1|::1):[0-9].*$</value>
-        <description>The whitelist to be applied for dispatches associated 
with the service roles specified by gateway.dispatch.whitelist.services.
-        If the value is DEFAULT, a domain-based whitelist will be derived from 
the Knox host.</description>
-    </property>
-    <property>
-        <name>gateway.xforwarded.header.context.append.servicename</name>
-        <value>LIVYSERVER</value>
-        <description>Add service name to x-forward-context header for the list 
of services defined above.</description>
-    </property>
-</configuration>

Reply via email to