You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2019/02/03 13:03:07 UTC
[maven-wagon] 01/01: [WAGON-552] Replace Commons Codec with Plexus
Utils
This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch WAGON-552
in repository https://gitbox.apache.org/repos/asf/maven-wagon.git
commit c4274a4e75ab4e5d6fbb50202bb054de696d2d2b
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Feb 3 14:02:55 2019 +0100
[WAGON-552] Replace Commons Codec with Plexus Utils
---
wagon-tcks/wagon-tck-http/pom.xml | 5 -----
.../org/apache/maven/wagon/tck/http/fixture/AuthSnoopFilter.java | 8 ++++----
.../maven/wagon/tck/http/fixture/ProxyAuthenticationFilter.java | 9 +++++----
3 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/wagon-tcks/wagon-tck-http/pom.xml b/wagon-tcks/wagon-tck-http/pom.xml
index 3462708..c73bcae 100644
--- a/wagon-tcks/wagon-tck-http/pom.xml
+++ b/wagon-tcks/wagon-tck-http/pom.xml
@@ -55,11 +55,6 @@ under the License.
<artifactId>wagon-provider-api</artifactId>
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>compile</scope>
diff --git a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/AuthSnoopFilter.java b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/AuthSnoopFilter.java
index dd23d9b..79110aa 100644
--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/AuthSnoopFilter.java
+++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/AuthSnoopFilter.java
@@ -20,6 +20,7 @@ package org.apache.maven.wagon.tck.http.fixture;
*/
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -29,13 +30,12 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.codec.binary.Base64;
-
+import org.codehaus.plexus.util.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- *
+ *
*/
public class AuthSnoopFilter
implements Filter
@@ -56,7 +56,7 @@ public class AuthSnoopFilter
{
logger.info( "Authorization: " + authHeader );
String data = authHeader.substring( "BASIC ".length() );
- String decoded = new String( Base64.decodeBase64( data ) );
+ String decoded = new String( Base64.decodeBase64( data.getBytes( StandardCharsets.US_ASCII ) ) );
logger.info( decoded );
String[] creds = decoded.split( ":" );
diff --git a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ProxyAuthenticationFilter.java b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ProxyAuthenticationFilter.java
index 2da6aa4..c851fee 100644
--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ProxyAuthenticationFilter.java
+++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ProxyAuthenticationFilter.java
@@ -19,9 +19,8 @@ package org.apache.maven.wagon.tck.http.fixture;
* under the License.
*/
-import org.apache.commons.codec.binary.Base64;
-
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -32,8 +31,10 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.codehaus.plexus.util.Base64;
+
/**
- *
+ *
*/
public class ProxyAuthenticationFilter
implements Filter
@@ -69,7 +70,7 @@ public class ProxyAuthenticationFilter
else
{
String data = header.substring( "BASIC ".length() );
- data = new String( Base64.decodeBase64( data ) );
+ data = new String( Base64.decodeBase64( data.getBytes( StandardCharsets.US_ASCII ) ) );
String[] creds = data.split( ":" );
if ( !creds[0].equals( username ) || !creds[1].equals( password ) )