Skip to content

Commit 722d969

Browse files
committed
DSP-24890 Adds DS Advanced Auth Client Plugin
Adds DataStax Advanced Auth Client Plugin with OIDC support. Updates project to JDK 11 (currently minimum requirement for the Auth Client Plugin) and removes checks for JDK 8.
1 parent bf7b100 commit 722d969

File tree

4 files changed

+33
-42
lines changed

4 files changed

+33
-42
lines changed

common/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
</exclusion>
7070
</exclusions>
7171
</dependency>
72+
<dependency>
73+
<groupId>com.datastax.db</groupId>
74+
<artifactId>db-advanced-auth-client-plugin</artifactId>
75+
</dependency>
7276
<dependency>
7377
<groupId>org.apache.kafka</groupId>
7478
<artifactId>kafka-clients</artifactId>
@@ -150,6 +154,10 @@
150154
<artifactId>spotbugs-annotations</artifactId>
151155
<scope>provided</scope>
152156
</dependency>
157+
<dependency>
158+
<groupId>com.nimbusds</groupId>
159+
<artifactId>oauth2-oidc-sdk</artifactId>
160+
</dependency>
153161
</dependencies>
154162
<build>
155163
<plugins>

common/src/main/java/com/datastax/oss/common/sink/state/LifeCycleManager.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import static com.datastax.oss.driver.api.core.config.DefaultDriverOption.SSL_TRUSTSTORE_PATH;
3232

3333
import com.codahale.metrics.MetricRegistry;
34+
import com.datastax.db.driver.api.plugin.auth.OIDCClientCredentialsAuthProvider;
35+
import com.datastax.db.driver.api.plugin.config.OIDCDriverOption;
3436
import com.datastax.dse.driver.api.core.config.DseDriverOption;
3537
import com.datastax.dse.driver.internal.core.auth.DseGssApiAuthProvider;
3638
import com.datastax.oss.common.sink.AbstractSinkTask;
@@ -621,14 +623,20 @@ private static void processAuthenticatorConfig(
621623
AUTH_PROVIDER_SASL_PROPERTIES, ImmutableMap.of("javax.security.sasl.qop", "auth"))
622624
.withStringMap(DseDriverOption.AUTH_PROVIDER_LOGIN_CONFIGURATION, loginConfig);
623625
} else if (authConfig.getProvider() == AuthenticatorConfig.Provider.OIDC) {
624-
/*
625-
TODO: OidcApiAuthProvider.
626-
configLoaderBuilder
627-
.withClass(AUTH_PROVIDER_CLASS, OidcApiAuthProvider.class)
628-
.withString(AUTH_PROVIDER_SERVICE, authConfig.getService())
629-
....
630-
*/
631-
throw new RuntimeException("TODO: OIDC authentication is not supported yet.");
626+
configLoaderBuilder
627+
.withClass(AUTH_PROVIDER_CLASS, OIDCClientCredentialsAuthProvider.class)
628+
.withString(
629+
OIDCDriverOption.AUTH_PROVIDER_OIDC_ISSUER, authConfig.getOIDCIssuer().toString())
630+
.withString(OIDCDriverOption.AUTH_PROVIDER_OIDC_CLIENT_ID, authConfig.getOIDCClientId())
631+
.withString(
632+
OIDCDriverOption.AUTH_PROVIDER_OIDC_CLIENT_SECRET, authConfig.getOIDCClientSecret())
633+
.withBoolean(OIDCDriverOption.AUTH_PROVIDER_OIDC_USE_TLS, authConfig.getOIDCUseTLS())
634+
.withString(
635+
OIDCDriverOption.AUTH_PROVIDER_OIDC_TRUSTSTORE_PATH,
636+
authConfig.getOIDCTruststorePath().toString())
637+
.withString(
638+
OIDCDriverOption.AUTH_PROVIDER_OIDC_TRUSTSTORE_PASSWORD,
639+
authConfig.getOIDCTruststorePassword());
632640
}
633641
}
634642

pom.xml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@
3737
<properties>
3838
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3939
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
40-
<java.version>1.8</java.version>
41-
<java.release.version>8</java.release.version>
40+
<java.version>11</java.version>
41+
<java.release.version>11</java.release.version>
4242
<kafka.connect.version>2.4.0</kafka.connect.version>
4343
<caffeine.version>2.6.2</caffeine.version>
4444
<oss.driver.version>4.16.0</oss.driver.version>
45+
<datastax.advanced-auth-client-plugin.version>1.0.1-SNAPSHOT</datastax.advanced-auth-client-plugin.version>
4546
<dsbulk.version>1.10.0</dsbulk.version>
4647
<reactive-streams.version>1.0.3</reactive-streams.version>
4748
<guava.version>25.1-jre</guava.version>
@@ -155,6 +156,11 @@
155156
<artifactId>java-driver-shaded-guava</artifactId>
156157
<version>${guava.version}</version>
157158
</dependency>
159+
<dependency>
160+
<groupId>com.datastax.db</groupId>
161+
<artifactId>db-advanced-auth-client-plugin</artifactId>
162+
<version>${datastax.advanced-auth-client-plugin.version}</version>
163+
</dependency>
158164
<dependency>
159165
<groupId>org.reactivestreams</groupId>
160166
<artifactId>reactive-streams</artifactId>
@@ -286,26 +292,6 @@ limitations under the License.]]></inlineHeader>
286292
<artifactId>license-maven-plugin</artifactId>
287293
<version>1.14</version>
288294
</plugin>
289-
<plugin>
290-
<groupId>org.codehaus.mojo</groupId>
291-
<artifactId>animal-sniffer-maven-plugin</artifactId>
292-
<version>1.16</version>
293-
<executions>
294-
<execution>
295-
<id>check-jdk8</id>
296-
<goals>
297-
<goal>check</goal>
298-
</goals>
299-
<configuration>
300-
<signature>
301-
<groupId>org.codehaus.mojo.signature</groupId>
302-
<artifactId>java18</artifactId>
303-
<version>1.0</version>
304-
</signature>
305-
</configuration>
306-
</execution>
307-
</executions>
308-
</plugin>
309295
<plugin>
310296
<groupId>org.apache.maven.plugins</groupId>
311297
<artifactId>maven-shade-plugin</artifactId>
@@ -430,10 +416,6 @@ limitations under the License.]]></inlineHeader>
430416
<groupId>com.mycila</groupId>
431417
<artifactId>license-maven-plugin</artifactId>
432418
</plugin>
433-
<plugin>
434-
<groupId>org.codehaus.mojo</groupId>
435-
<artifactId>animal-sniffer-maven-plugin</artifactId>
436-
</plugin>
437419
<plugin>
438420
<artifactId>maven-compiler-plugin</artifactId>
439421
</plugin>

text/pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<artifactId>dsbulk-codecs</artifactId>
2323
<groupId>com.datastax.oss</groupId>
2424
<version>1.10.0</version>
25-
<relativePath />
25+
<relativePath/>
2626
</parent>
2727
<groupId>com.datastax.oss</groupId>
2828
<version>1.0.16-SNAPSHOT</version>
@@ -120,13 +120,6 @@
120120
<target>8</target>
121121
</configuration>
122122
</plugin>
123-
<plugin>
124-
<groupId>org.codehaus.mojo</groupId>
125-
<artifactId>animal-sniffer-maven-plugin</artifactId>
126-
<configuration>
127-
<skip>true</skip>
128-
</configuration>
129-
</plugin>
130123
</plugins>
131124
</build>
132125
</project>

0 commit comments

Comments
 (0)