From 9540fc45ad517b1330850996638aa477882ae051 Mon Sep 17 00:00:00 2001 From: KK Date: Tue, 13 Sep 2022 11:14:37 +0200 Subject: [PATCH] #117 Removed unnecessary dependency --- dependencies.md | 149 +++++++++--------- doc/changes/changes_10.0.0.md | 10 ++ pom.xml | 12 +- .../KerberosConfigurationCreator.java | 9 +- .../jdbc/RemoteConnectionFactoryTest.java | 9 +- .../KerberosConfigurationCreatorTest.java | 9 ++ 6 files changed, 104 insertions(+), 94 deletions(-) diff --git a/dependencies.md b/dependencies.md index 9d16016..12467c4 100644 --- a/dependencies.md +++ b/dependencies.md @@ -3,91 +3,88 @@ ## Compile Dependencies -| Dependency | License | -| ----------------------------------------------------- | ------------------------------- | -| [Common module of Exasol Virtual Schemas Adapters][0] | [The MIT License (MIT)][1] | -| [jaxb-api][2] | [CDDL 1.1][3]; [GPL2 w/ CPE][3] | -| [Test utilities for `java.util.logging`][4] | [MIT][5] | -| [error-reporting-java][6] | [MIT][5] | +| Dependency | License | +| ----------------------------------------------------- | -------------------------- | +| [Common module of Exasol Virtual Schemas Adapters][0] | [The MIT License (MIT)][1] | +| [error-reporting-java][2] | [MIT][3] | ## Test Dependencies -| Dependency | License | -| ----------------------------------------------------------- | ---------------------------------------------- | -| [Hamcrest][7] | [BSD License 3][8] | -| [JSONassert][9] | [The Apache Software License, Version 2.0][10] | -| [JUnit Jupiter (Aggregator)][11] | [Eclipse Public License v2.0][12] | -| [EqualsVerifier | release normal jar][13] | [Apache License, Version 2.0][14] | -| [mockito-junit-jupiter][15] | [The MIT License][16] | -| [Apache Derby Database Engine and Embedded JDBC Driver][17] | [Apache 2][10] | +| Dependency | License | +| ----------------------------------------------------------- | --------------------------------------------- | +| [Test utilities for `java.util.logging`][4] | [MIT][3] | +| [Hamcrest][5] | [BSD License 3][6] | +| [JSONassert][7] | [The Apache Software License, Version 2.0][8] | +| [JUnit Jupiter (Aggregator)][9] | [Eclipse Public License v2.0][10] | +| [EqualsVerifier | release normal jar][11] | [Apache License, Version 2.0][12] | +| [mockito-junit-jupiter][13] | [The MIT License][14] | +| [Apache Derby Database Engine and Embedded JDBC Driver][15] | [Apache 2][8] | ## Plugin Dependencies | Dependency | License | | ------------------------------------------------------- | --------------------------------- | -| [SonarQube Scanner for Maven][18] | [GNU LGPL 3][19] | -| [Apache Maven Compiler Plugin][20] | [Apache License, Version 2.0][14] | -| [Apache Maven Enforcer Plugin][21] | [Apache License, Version 2.0][14] | -| [Maven Flatten Plugin][22] | [Apache Software Licenese][10] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][23] | [ASL2][10] | -| [Maven Surefire Plugin][24] | [Apache License, Version 2.0][14] | -| [Versions Maven Plugin][25] | [Apache License, Version 2.0][14] | -| [Apache Maven Deploy Plugin][26] | [Apache License, Version 2.0][14] | -| [Apache Maven GPG Plugin][27] | [Apache License, Version 2.0][14] | -| [Apache Maven Source Plugin][28] | [Apache License, Version 2.0][14] | -| [Apache Maven Javadoc Plugin][29] | [Apache License, Version 2.0][14] | -| [Nexus Staging Maven Plugin][30] | [Eclipse Public License][31] | -| [JaCoCo :: Maven Plugin][32] | [Eclipse Public License 2.0][33] | -| [error-code-crawler-maven-plugin][34] | [MIT License][35] | -| [Reproducible Build Maven Plugin][36] | [Apache 2.0][10] | -| [Apache Maven JAR Plugin][37] | [Apache License, Version 2.0][14] | -| [Project keeper maven plugin][38] | [The MIT License][39] | -| [Apache Maven Clean Plugin][40] | [Apache License, Version 2.0][14] | -| [Apache Maven Resources Plugin][41] | [Apache License, Version 2.0][14] | -| [Apache Maven Install Plugin][42] | [Apache License, Version 2.0][10] | -| [Apache Maven Site Plugin][43] | [Apache License, Version 2.0][14] | +| [SonarQube Scanner for Maven][16] | [GNU LGPL 3][17] | +| [Apache Maven Compiler Plugin][18] | [Apache License, Version 2.0][12] | +| [Apache Maven Enforcer Plugin][19] | [Apache License, Version 2.0][12] | +| [Maven Flatten Plugin][20] | [Apache Software Licenese][8] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][21] | [ASL2][8] | +| [Maven Surefire Plugin][22] | [Apache License, Version 2.0][12] | +| [Versions Maven Plugin][23] | [Apache License, Version 2.0][12] | +| [Apache Maven Deploy Plugin][24] | [Apache License, Version 2.0][12] | +| [Apache Maven GPG Plugin][25] | [Apache License, Version 2.0][12] | +| [Apache Maven Source Plugin][26] | [Apache License, Version 2.0][12] | +| [Apache Maven Javadoc Plugin][27] | [Apache License, Version 2.0][12] | +| [Nexus Staging Maven Plugin][28] | [Eclipse Public License][29] | +| [JaCoCo :: Maven Plugin][30] | [Eclipse Public License 2.0][31] | +| [error-code-crawler-maven-plugin][32] | [MIT License][33] | +| [Reproducible Build Maven Plugin][34] | [Apache 2.0][8] | +| [Apache Maven JAR Plugin][35] | [Apache License, Version 2.0][12] | +| [Project keeper maven plugin][36] | [The MIT License][37] | +| [Apache Maven Clean Plugin][38] | [Apache License, Version 2.0][12] | +| [Apache Maven Resources Plugin][39] | [Apache License, Version 2.0][12] | +| [Apache Maven Install Plugin][40] | [Apache License, Version 2.0][8] | +| [Apache Maven Site Plugin][41] | [Apache License, Version 2.0][12] | [0]: https://github.com/exasol/virtual-schema-common-java/ [1]: https://github.com/exasol/virtual-schema-common-java/blob/main/LICENSE -[2]: https://github.com/eclipse-ee4j/jaxb-api -[3]: https://oss.oracle.com/licenses/CDDL+GPL-1.1 +[2]: https://github.com/exasol/error-reporting-java +[3]: https://opensource.org/licenses/MIT [4]: https://github.com/exasol/java-util-logging-testing -[5]: https://opensource.org/licenses/MIT -[6]: https://github.com/exasol/error-reporting-java -[7]: http://hamcrest.org/JavaHamcrest/ -[8]: http://opensource.org/licenses/BSD-3-Clause -[9]: https://github.com/skyscreamer/JSONassert -[10]: http://www.apache.org/licenses/LICENSE-2.0.txt -[11]: https://junit.org/junit5/ -[12]: https://www.eclipse.org/legal/epl-v20.html -[13]: https://www.jqno.nl/equalsverifier -[14]: https://www.apache.org/licenses/LICENSE-2.0.txt -[15]: https://github.com/mockito/mockito -[16]: https://github.com/mockito/mockito/blob/main/LICENSE -[17]: http://db.apache.org/derby/ -[18]: http://sonarsource.github.io/sonar-scanner-maven/ -[19]: http://www.gnu.org/licenses/lgpl.txt -[20]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[21]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[22]: https://www.mojohaus.org/flatten-maven-plugin/ -[23]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[24]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[25]: http://www.mojohaus.org/versions-maven-plugin/ -[26]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[27]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[28]: https://maven.apache.org/plugins/maven-source-plugin/ -[29]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[30]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[31]: http://www.eclipse.org/legal/epl-v10.html -[32]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[33]: https://www.eclipse.org/legal/epl-2.0/ -[34]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[35]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[36]: http://zlika.github.io/reproducible-build-maven-plugin -[37]: https://maven.apache.org/plugins/maven-jar-plugin/ -[38]: https://github.com/exasol/project-keeper/ -[39]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[40]: https://maven.apache.org/plugins/maven-clean-plugin/ -[41]: https://maven.apache.org/plugins/maven-resources-plugin/ -[42]: http://maven.apache.org/plugins/maven-install-plugin/ -[43]: https://maven.apache.org/plugins/maven-site-plugin/ +[5]: http://hamcrest.org/JavaHamcrest/ +[6]: http://opensource.org/licenses/BSD-3-Clause +[7]: https://github.com/skyscreamer/JSONassert +[8]: http://www.apache.org/licenses/LICENSE-2.0.txt +[9]: https://junit.org/junit5/ +[10]: https://www.eclipse.org/legal/epl-v20.html +[11]: https://www.jqno.nl/equalsverifier +[12]: https://www.apache.org/licenses/LICENSE-2.0.txt +[13]: https://github.com/mockito/mockito +[14]: https://github.com/mockito/mockito/blob/main/LICENSE +[15]: http://db.apache.org/derby/ +[16]: http://sonarsource.github.io/sonar-scanner-maven/ +[17]: http://www.gnu.org/licenses/lgpl.txt +[18]: https://maven.apache.org/plugins/maven-compiler-plugin/ +[19]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ +[20]: https://www.mojohaus.org/flatten-maven-plugin/ +[21]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[22]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[23]: http://www.mojohaus.org/versions-maven-plugin/ +[24]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[25]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[26]: https://maven.apache.org/plugins/maven-source-plugin/ +[27]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[28]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[29]: http://www.eclipse.org/legal/epl-v10.html +[30]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[31]: https://www.eclipse.org/legal/epl-2.0/ +[32]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[33]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[34]: http://zlika.github.io/reproducible-build-maven-plugin +[35]: https://maven.apache.org/plugins/maven-jar-plugin/ +[36]: https://github.com/exasol/project-keeper/ +[37]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[38]: https://maven.apache.org/plugins/maven-clean-plugin/ +[39]: https://maven.apache.org/plugins/maven-resources-plugin/ +[40]: http://maven.apache.org/plugins/maven-install-plugin/ +[41]: https://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changes_10.0.0.md b/doc/changes/changes_10.0.0.md index 37151fe..c1b3f0e 100644 --- a/doc/changes/changes_10.0.0.md +++ b/doc/changes/changes_10.0.0.md @@ -15,11 +15,21 @@ Starting with major version 8 Exasol database uses the capabilities reported by * #119: Changed SQL generator to format decimals always with decimal point `.` independent of the locale.
Before method `SqlGenerationVisitor.visit(SqlLiteralDouble)` for instance returned values with decimal point `,` when the locale was set to `en_DE`. +## Refactoring + +* #117 Removed unnecessary dependency + ## Dependency Updates ### Compile Dependency Updates +* Removed `com.exasol:java-util-logging-testing:2.0.1` * Updated `com.exasol:virtual-schema-common-java:15.3.2` to `16.1.0` +* Removed `javax.xml.bind:jaxb-api:2.4.0-b180830.0359` + +### Test Dependency Updates + +* Added `com.exasol:java-util-logging-testing:2.0.1` ### Plugin Dependency Updates diff --git a/pom.xml b/pom.xml index 6e54568..e60ae98 100644 --- a/pom.xml +++ b/pom.xml @@ -29,19 +29,15 @@ 16.1.0 - javax.xml.bind - jaxb-api - 2.4.0-b180830.0359 + com.exasol + error-reporting-java + 0.4.1 com.exasol java-util-logging-testing 2.0.1 - - - com.exasol - error-reporting-java - 0.4.1 + test org.hamcrest diff --git a/src/main/java/com/exasol/auth/kerberos/KerberosConfigurationCreator.java b/src/main/java/com/exasol/auth/kerberos/KerberosConfigurationCreator.java index ba4363e..c98eb00 100644 --- a/src/main/java/com/exasol/auth/kerberos/KerberosConfigurationCreator.java +++ b/src/main/java/com/exasol/auth/kerberos/KerberosConfigurationCreator.java @@ -1,10 +1,9 @@ package com.exasol.auth.kerberos; -import static javax.xml.bind.DatatypeConverter.parseBase64Binary; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Base64; import java.util.logging.Logger; import com.exasol.errorreporting.ExaError; @@ -82,12 +81,14 @@ private Path createCommonDirectoryForKerberosConfigurationFiles() throws IOExcep private Path createTemporaryKerberosConfigFile(final String base64EncodedKerberosConfig, final Path temporaryDirectory) throws IOException { - return createTemporaryFile(temporaryDirectory, "krb_", ".conf", parseBase64Binary(base64EncodedKerberosConfig)); + return createTemporaryFile(temporaryDirectory, "krb_", ".conf", + Base64.getDecoder().decode(base64EncodedKerberosConfig.getBytes())); } private Path createTemporaryKeyTabFile(final String base64EncodedKeyTab, final Path temporaryDirectory) throws IOException { - return createTemporaryFile(temporaryDirectory, "kt_", ".keytab", parseBase64Binary(base64EncodedKeyTab)); + return createTemporaryFile(temporaryDirectory, "kt_", ".keytab", + Base64.getDecoder().decode(base64EncodedKeyTab.getBytes())); } private Path createTemporaryFile(final Path temporaryDirectory, final String prefix, final String suffix, diff --git a/src/test/java/com/exasol/adapter/jdbc/RemoteConnectionFactoryTest.java b/src/test/java/com/exasol/adapter/jdbc/RemoteConnectionFactoryTest.java index 9381bb3..6168e9c 100644 --- a/src/test/java/com/exasol/adapter/jdbc/RemoteConnectionFactoryTest.java +++ b/src/test/java/com/exasol/adapter/jdbc/RemoteConnectionFactoryTest.java @@ -12,10 +12,7 @@ import java.sql.Connection; import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.DatatypeConverter; +import java.util.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -86,8 +83,8 @@ void testGetConnectionWithInaccessibleNamedConnectionThrowsException() throws Ex @Test void testGetConnectionWithKerberosDetailsInNamedConnection() throws SQLException, ExaConnectionAccessException { final String principal = "the_kerberos_principal"; - final String base64EncodedKerberosConfig = DatatypeConverter.printBase64Binary("".getBytes()); - final String base64EncodedKeyTab = DatatypeConverter.printBase64Binary("".getBytes()); + final String base64EncodedKerberosConfig = Base64.getEncoder().encodeToString("".getBytes()); + final String base64EncodedKeyTab = Base64.getEncoder().encodeToString("".getBytes()); final String credentialString = "ExaAuthType=Kerberos;" + base64EncodedKerberosConfig + ";" + base64EncodedKeyTab; when(this.exaConnectionMock.getUser()).thenReturn(principal); diff --git a/src/test/java/com/exasol/auth/kerberos/KerberosConfigurationCreatorTest.java b/src/test/java/com/exasol/auth/kerberos/KerberosConfigurationCreatorTest.java index 1da7eff..f49a643 100644 --- a/src/test/java/com/exasol/auth/kerberos/KerberosConfigurationCreatorTest.java +++ b/src/test/java/com/exasol/auth/kerberos/KerberosConfigurationCreatorTest.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.Base64; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -53,6 +54,14 @@ void testWriteKerberosConfigurationFiles() { () -> assertKeyTableFileContent(getJaasConfigPathFromProperty())); } + @Test + void base64() { + final byte[] raw = "some string".getBytes(); + final byte[] encoded = Base64.getEncoder().encode(raw); + final byte[] decoded = Base64.getDecoder().decode(encoded); + assertThat(decoded, equalTo(raw)); + } + private String getJaasConfigPathFromProperty() { return System.getProperty(LOGIN_CONFIG_PROPERTY); }