Skip to content

Commit

Permalink
Remove dependency on com.microsoft.azure:adal4j
Browse files Browse the repository at this point in the history
Follow-up to quarkusio#22584
  • Loading branch information
gastaldi committed Feb 24, 2022
1 parent d53b6c9 commit 207f81e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 67 deletions.
47 changes: 0 additions & 47 deletions extensions/jdbc/jdbc-mssql/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,53 +27,6 @@
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
</dependency>
<!--
adal4j isn't used directly but you need to have it around for compilation to succeed.
Since that's the only reason, doesn't seem necessary to require the specific version in the shared bom.
-->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.6.6</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.stephenc.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.nimbusds</groupId>
<artifactId>lang-tag</artifactId>
</exclusion>
<exclusion>
<groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId>
</exclusion>
<exclusion>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
package io.quarkus.jdbc.mssql.runtime.graal.com.microsoft.sqlserver.jdbc;

import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.RecomputeFieldValue;
import com.oracle.svm.core.annotate.Delete;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

@TargetClass(className = "com.microsoft.sqlserver.jdbc.SQLServerADAL4JUtils")
@Substitute
@Delete
final class SQLServerADAL4JUtils {

@Alias
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)
static final private java.util.logging.Logger adal4jLogger = null;

@Substitute
static QuarkusSqlFedAuthToken getSqlFedAuthToken(QuarkusSqlFedAuthInfo fedAuthInfo, String user, String password,
String authenticationString) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}

@Substitute
static QuarkusSqlFedAuthToken getSqlFedAuthTokenIntegrated(QuarkusSqlFedAuthInfo fedAuthInfo, String authenticationString) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}

}

@TargetClass(className = "com.microsoft.sqlserver.jdbc.SqlFedAuthToken")
Expand All @@ -39,6 +22,16 @@ final class QuarkusSqlFedAuthInfo {
@TargetClass(className = "com.microsoft.sqlserver.jdbc.SQLServerConnection")
final class QuarkusSQLServerConnection {

@Substitute
private void validateAdalLibrary(String errorMessage) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}

@Substitute
private QuarkusSqlFedAuthToken getFedAuthToken(QuarkusSqlFedAuthInfo fedAuthInfo) {
throw new IllegalStateException("Quarkus does not support Active Directory based authentication");
}

@Substitute
private QuarkusSqlFedAuthToken getMSIAuthToken(String resource, String msiClientId) {
throw new IllegalStateException("Quarkus does not support MSI based authentication");
Expand All @@ -48,4 +41,4 @@ private QuarkusSqlFedAuthToken getMSIAuthToken(String resource, String msiClient

class SQLServerJDBCSubstitutions {

}
}

0 comments on commit 207f81e

Please sign in to comment.