knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject [knox] branch master updated: KNOX-2227 - Strip Leading and Trailing Whitespace from Headers in KnoxShellTable (#258)
Date Sat, 08 Feb 2020 20:56:17 GMT
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 fad5763  KNOX-2227 - Strip Leading and Trailing Whitespace from Headers in KnoxShellTable
(#258)
fad5763 is described below

commit fad576388df3297e79a611d407e7a700b0d27b9c
Author: lmccay <lmccay@apache.org>
AuthorDate: Sat Feb 8 15:56:09 2020 -0500

    KNOX-2227 - Strip Leading and Trailing Whitespace from Headers in KnoxShellTable (#258)
    
    * KNOX-1742 - add to knoxshell usage rendering
    
    * KNOX-2188 - Handling discovery details via advanced configuration (#240)
    
    * KNOX-2190 - Processing advanced service discovery configuration on topology level (#242)
    
    * KNOX-1742 - Fix javadoc warning
    
    * KNOX-2196 - Upgrade caffeine to 2.8.1
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2197 - Upgrade dependency-check-maven to 5.3.0
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2198 - Upgrade groovy to 2.5.9
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2192 - Upgrade httpclient to 4.5.11
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2195 - Upgrade jetty to 9.4.26.v20200117
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2193 - Upgrade rest-assured to 4.2.0
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2199 - Upgrade spring-core to 5.2.3.RELEASE
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2194 - Upgrade spring-vault to 2.2.1.RELEASE
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2191 - Upgrade testcontainers to 1.12.5
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2200 - DefaultKeystoreService can lose entries under concurrent access (#243)
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2202 - Knox should use UTF-8 as default encoding instead of ISO-8859-1 (#244)
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2204 - KnoxLine NPE list datasources when directories don't exist (#246)
    
    * KNOX-1742 - add to knoxshell usage rendering
    
    * KNOX-2204 - KnoxLine NPE list datasources when directories don't exist
    
    * KNOX-2203 - Upgrade admin-ui npm dependencies (#245)
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2208 - AclsAuthorizationFilter should log access at DEBUG level (#247)
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2153 - CM discovery - Monitor Cloudera Manager (#239)
    
    * KNOX-2206 - Log exclusion of a discovered service due to configuration issues (#248)
    
    * KNOX-2209 - Improve logging for Knox token handling (#250)
    
    * KNOX-2217 - Upgrade apache pom to 23
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2219 - Upgrade checkstyle to 8.29
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2218 - Upgrade easymock to 4.2
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2220 - Upgrade nimbus-jose-jwt to 8.5
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
    
    * KNOX-2213 - Service Discovery Support for CM UI, API (#249)
    
    * KNOX-2215 - Token service should return a 403 response when the renewer is not white-listed
(#251)
    
    * KNOX-2224 - KnoxLine and KnoxShell DataSource and Select Command Alignment (#255)
    
    * KNOX-1742 - add to knoxshell usage rendering
    
    * KNOX-2204 - KnoxLine NPE list datasources when directories don't exist
    
    * KNOX-2224 - KnoxLine and KnoxShell DataSource and Select Command Alignment
    
    Change-Id: I55aef2dd7617baf10c5f9eb7706f61436aa3ad7d
    
    * KNOX-2227 - Strip Leading and Trailing Whitespace from Headers in KnoxShellTable
    
    Change-Id: I7778becab1ffe779350dbdd15472d308fa165f5f
    
    * KNOX-2227 - switch to trim() for java 8
    
    Change-Id: I9b8ba618c13de6bff0edb5c7d318cd28c251fa20
    
    Co-authored-by: Sandor Molnar <smolnar@apache.org>
    Co-authored-by: Kevin Risden <risdenk@users.noreply.github.com>
    Co-authored-by: Phil Zampino <pzampino@apache.org>
    Co-authored-by: Sandeep Moré <moresandeep@gmail.com>
---
 .../java/org/apache/knox/gateway/shell/table/KnoxShellTable.java  | 2 +-
 .../org/apache/knox/gateway/shell/table/KnoxShellTableTest.java   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
index daaea31..15d403c 100644
--- a/gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
+++ b/gateway-shell/src/main/java/org/apache/knox/gateway/shell/table/KnoxShellTable.java
@@ -65,7 +65,7 @@ public class KnoxShellTable {
   }
 
   public KnoxShellTable header(String header) {
-    headers.add(header);
+    headers.add(header.trim());
     return this;
   }
 
diff --git a/gateway-shell/src/test/java/org/apache/knox/gateway/shell/table/KnoxShellTableTest.java
b/gateway-shell/src/test/java/org/apache/knox/gateway/shell/table/KnoxShellTableTest.java
index 3d8c571..cde34f9 100644
--- a/gateway-shell/src/test/java/org/apache/knox/gateway/shell/table/KnoxShellTableTest.java
+++ b/gateway-shell/src/test/java/org/apache/knox/gateway/shell/table/KnoxShellTableTest.java
@@ -638,4 +638,12 @@ public class KnoxShellTableTest {
     KnoxShellTableCallHistory.getInstance().saveCall(table2.getId(), new KnoxShellTableCall("class2",
"method2", false, Collections.singletonMap("param2", String.class)));
     assertNotEquals(table1.getCallHistoryList(), table2.getCallHistoryList());
   }
+
+  @Test
+  public void testHeadersStrippingWhitespace() throws Exception {
+    KnoxShellTable table = new KnoxShellTable();
+    table.header(" ColumnA ").header("ColumnB").header("ColumnC");
+
+    assertEquals(table.headers.get(1).indexOf(' '), -1);
+  }
 }


Mime
View raw message