Merge pull request #143 from battags/CASC-127

CASC-127 Remove Commons Codec Dependency
This commit is contained in:
Scott 2015-11-19 21:02:57 -05:00
commit e4b767700a
4 changed files with 8 additions and 16 deletions

View File

@ -36,14 +36,6 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>

View File

@ -19,6 +19,7 @@
package org.jasig.cas.client.session;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.zip.Inflater;
@ -26,8 +27,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Base64;
import org.jasig.cas.client.Protocol;
import org.jasig.cas.client.configuration.ConfigurationKeys;
import org.jasig.cas.client.util.CommonUtils;
@ -146,7 +147,7 @@ public final class SingleSignOutHandler {
if (this.artifactParameterOverPost) {
this.safeParameters = Arrays.asList(this.logoutParameterName, this.artifactParameterName);
} else {
this.safeParameters = Arrays.asList(this.logoutParameterName);
this.safeParameters = Collections.singletonList(this.logoutParameterName);
}
}
}
@ -256,7 +257,7 @@ public final class SingleSignOutHandler {
* @return the uncompressed logout message.
*/
private String uncompressLogoutMessage(final String originalMessage) {
final byte[] binaryMessage = Base64.decodeBase64(originalMessage);
final byte[] binaryMessage = DatatypeConverter.parseBase64Binary(originalMessage);
Inflater decompresser = null;
try {

View File

@ -18,12 +18,11 @@
*/
package org.jasig.cas.client.session;
import javax.xml.bind.DatatypeConverter;
import java.nio.charset.Charset;
import java.util.Date;
import java.util.zip.Deflater;
import org.apache.commons.codec.binary.Base64;
/**
* Logout message generator to perform tests on Single Sign Out feature.
* Greatly inspired by the source code in the CAS server itself.
@ -51,6 +50,6 @@ public final class LogoutMessageGenerator {
final int resultSize = deflater.deflate(buffer);
final byte[] output = new byte[resultSize];
System.arraycopy(buffer, 0, output, 0, resultSize);
return Base64.encodeBase64String(output);
return DatatypeConverter.printBase64Binary(output);
}
}

View File

@ -76,8 +76,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>