knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject [knox] branch master updated: KNOX-1837 - Remove ServiceTestResource glassfish Base64 dependency
Date Fri, 29 Mar 2019 19:44:49 GMT
This is an automated email from the ASF dual-hosted git repository.

krisden 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 32d8ac6  KNOX-1837 - Remove ServiceTestResource glassfish Base64 dependency
32d8ac6 is described below

commit 32d8ac6a1ed216e42138aec7f37d709c4a970037
Author: Kevin Risden <krisden@apache.org>
AuthorDate: Fri Mar 29 14:41:16 2019 -0400

    KNOX-1837 - Remove ServiceTestResource glassfish Base64 dependency
    
    Close apache/knox#81
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
---
 gateway-service-test/pom.xml                                        | 5 -----
 .../org/apache/knox/gateway/service/test/ServiceTestResource.java   | 6 ++++--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gateway-service-test/pom.xml b/gateway-service-test/pom.xml
index ce9952c..2f7034c 100644
--- a/gateway-service-test/pom.xml
+++ b/gateway-service-test/pom.xml
@@ -74,11 +74,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.glassfish.jersey.core</groupId>
-            <artifactId>jersey-common</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpcore</artifactId>
         </dependency>
diff --git a/gateway-service-test/src/main/java/org/apache/knox/gateway/service/test/ServiceTestResource.java
b/gateway-service-test/src/main/java/org/apache/knox/gateway/service/test/ServiceTestResource.java
index 1d39ff0..36154d2 100644
--- a/gateway-service-test/src/main/java/org/apache/knox/gateway/service/test/ServiceTestResource.java
+++ b/gateway-service-test/src/main/java/org/apache/knox/gateway/service/test/ServiceTestResource.java
@@ -29,7 +29,6 @@ import org.apache.knox.gateway.services.GatewayServices;
 import org.apache.knox.gateway.services.topology.TopologyService;
 import org.apache.knox.gateway.topology.Service;
 import org.apache.knox.gateway.topology.Topology;
-import org.glassfish.jersey.internal.util.Base64;
 
 import javax.net.ssl.SSLContext;
 import javax.servlet.http.HttpServletRequest;
@@ -49,6 +48,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.Base64;
 import java.util.List;
 import java.util.Map;
 
@@ -77,7 +77,9 @@ public class ServiceTestResource {
 
 //    Create Authorization String
     if( username != null && password != null) {
-      authString = "Basic " + Base64.encodeAsString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
+      String base64EncodedUserPass = Base64.getEncoder().encodeToString(
+          (username + ":" + password).getBytes(StandardCharsets.UTF_8));
+      authString = "Basic " + base64EncodedUserPass;
     } else if (request.getHeader("Authorization") != null) {
       authString = request.getHeader("Authorization");
     } else {


Mime
View raw message