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 #22584
  • Loading branch information
gastaldi authored and sschu committed Mar 20, 2022
1 parent 8af7cb4 commit ef6b48f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
7 changes: 0 additions & 7 deletions extensions/jdbc/jdbc-mssql/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +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.
-->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
</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 ef6b48f

Please sign in to comment.