Elffuss BraidHub

kikocis/java-driver public

Remove DSE module.

Starting with the upcoming DSE 5.0, it will be published as a separate
artifact.
Changeset5366b0f3c217e690f56d13f53b02ea8bf91a7d837c2d4fb330caabe77569f2b8
Authorolim7t <omichallat+github@gmail.com> · 2016-01-26 15:31 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-01-26 15:31 +01:00
Parentsddcb7a9a9161

Browse the files at this changeset

8 files changed

modified driver-dist/pom.xml +0 −6
@@ -42,12 +42,6 @@
4242 <version>${project.parent.version}</version>
4343 </dependency>
4444
45- <dependency>
46- <groupId>com.datastax.cassandra</groupId>
47- <artifactId>cassandra-driver-dse</artifactId>
48- <version>${project.parent.version}</version>
49- </dependency>
50-
5145 <dependency>
5246 <groupId>com.datastax.cassandra</groupId>
5347 <artifactId>cassandra-driver-mapping</artifactId>
modified driver-dist/src/assembly/binary-tarball.xml +0 −2
@@ -28,7 +28,6 @@
2828 <useAllReactorProjects>true</useAllReactorProjects>
2929 <includes>
3030 <include>com.datastax.cassandra:cassandra-driver-core</include>
31- <include>com.datastax.cassandra:cassandra-driver-dse</include>
3231 <include>com.datastax.cassandra:cassandra-driver-mapping</include>
3332 <include>com.datastax.cassandra:cassandra-driver-extras</include>
3433 </includes>
@@ -49,7 +48,6 @@
4948 <useAllReactorProjects>true</useAllReactorProjects>
5049 <includes>
5150 <include>com.datastax.cassandra:cassandra-driver-core</include>
52- <include>com.datastax.cassandra:cassandra-driver-dse</include>
5351 <include>com.datastax.cassandra:cassandra-driver-mapping</include>
5452 <include>com.datastax.cassandra:cassandra-driver-extras</include>
5553 </includes>
deleted driver-dse/pom.xml +0 −91
@@ -1,91 +0,0 @@
1-<!--
2-
3- Copyright (C) 2012-2015 DataStax Inc.
4-
5- Licensed under the Apache License, Version 2.0 (the "License");
6- you may not use this file except in compliance with the License.
7- You may obtain a copy of the License at
8-
9- http://www.apache.org/licenses/LICENSE-2.0
10-
11- Unless required by applicable law or agreed to in writing, software
12- distributed under the License is distributed on an "AS IS" BASIS,
13- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14- See the License for the specific language governing permissions and
15- limitations under the License.
16-
17--->
18-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
20- <modelVersion>4.0.0</modelVersion>
21- <parent>
22- <groupId>com.datastax.cassandra</groupId>
23- <artifactId>cassandra-driver-parent</artifactId>
24- <version>3.0.0-SNAPSHOT</version>
25- </parent>
26- <artifactId>cassandra-driver-dse</artifactId>
27- <packaging>bundle</packaging>
28- <name>DataStax Java Driver for Apache Cassandra - DataStax Enterprise Module</name>
29- <description>Extensions to the CQL driver for use with DataStax Enterprise.</description>
30- <url>https://github.com/datastax/java-driver</url>
31-
32- <properties>
33- <main.basedir>${project.parent.basedir}</main.basedir>
34- </properties>
35-
36- <dependencies>
37- <dependency>
38- <groupId>com.datastax.cassandra</groupId>
39- <artifactId>cassandra-driver-core</artifactId>
40- <version>${project.parent.version}</version>
41- </dependency>
42- </dependencies>
43-
44- <build>
45- <plugins>
46- <plugin>
47- <groupId>org.apache.felix</groupId>
48- <artifactId>maven-bundle-plugin</artifactId>
49- <extensions>true</extensions>
50- <version>2.4.0</version>
51- <configuration>
52- <instructions>
53- <Bundle-SymbolicName>com.datastax.driver.dse</Bundle-SymbolicName>
54- <Bundle-Version>${project.version}</Bundle-Version>
55- <_include>-osgi.bnd</_include>
56- </instructions>
57- <supportedProjectTypes>
58- <supportedProjectType>jar</supportedProjectType>
59- <supportedProjectType>bundle</supportedProjectType>
60- <supportedProjectType>pom</supportedProjectType>
61- </supportedProjectTypes>
62- </configuration>
63- </plugin>
64- </plugins>
65- </build>
66-
67- <licenses>
68- <license>
69- <name>Apache 2</name>
70- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
71- <distribution>repo</distribution>
72- <comments>Apache License Version 2.0</comments>
73- </license>
74- </licenses>
75-
76- <scm>
77- <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
78- <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
79- <url>https://github.com/datastax/java-driver</url>
80- <tag>HEAD</tag>
81- </scm>
82-
83- <developers>
84- <developer>
85- <name>Various</name>
86- <organization>DataStax</organization>
87- </developer>
88- </developers>
89-
90-</project>
91-
deleted driver-dse/src/main/java/com/datastax/driver/auth/BaseDseAuthenticator.java +0 −69
@@ -1,69 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.auth;
17-
18-import com.datastax.driver.core.Authenticator;
19-
20-/**
21- * Base class for {@link Authenticator} implementations that want to make use of
22- * the authentication scheme negotiation in the DseAuthenticator
23- */
24-abstract class BaseDseAuthenticator implements Authenticator {
25- private static final String DSE_AUTHENTICATOR = "com.datastax.bdp.cassandra.auth.DseAuthenticator";
26- private final String authenticator;
27-
28- protected BaseDseAuthenticator(String authenticator) {
29- this.authenticator = authenticator;
30- }
31-
32- /**
33- * Return a byte array containing the required SASL mechanism.
34- * This should be one of:
35- * <ul>
36- * <li>"PLAIN".getBytes(Charsets.UTF_8);</li>
37- * <li>"GSSAPI".getBytes(Charsets.UTF_8);</li>
38- * </ul>
39- *
40- * @return a byte array containing the SASL mechanism
41- */
42- public abstract byte[] getMechanism();
43-
44- /**
45- * Return a byte array containing the expected successful server challenge.
46- * This should be one of:
47- * <ul>
48- * <li>"PLAIN-START".getBytes(Charsets.UTF_8);</li>
49- * <li>"GSSAPI-START".getBytes(Charsets.UTF_8);</li>
50- * </ul>
51- *
52- * @return a byte array containing the server challenge
53- */
54- public abstract byte[] getInitialServerChallenge();
55-
56- public byte[] initialResponse() {
57- if (isDseAuthenticator())
58- return getMechanism();
59- else
60- return evaluateChallenge(getInitialServerChallenge());
61- }
62-
63- public void onAuthenticationSuccess(byte[] token) {
64- }
65-
66- private boolean isDseAuthenticator() {
67- return authenticator.equals(DSE_AUTHENTICATOR);
68- }
69-}
deleted driver-dse/src/main/java/com/datastax/driver/auth/DseAuthProvider.java +0 −25
@@ -1,25 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.auth;
17-
18-/**
19- * @deprecated in favor of {@link DseGSSAPIAuthProvider}
20- * <p/>
21- * Please look at {@link DseGSSAPIAuthProvider} documentation for configuration
22- */
23-@Deprecated
24-public class DseAuthProvider extends DseGSSAPIAuthProvider {
25-}
deleted driver-dse/src/main/java/com/datastax/driver/auth/DseGSSAPIAuthProvider.java +0 −156
@@ -1,156 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.auth;
17-
18-import com.datastax.driver.core.AuthProvider;
19-import com.datastax.driver.core.Authenticator;
20-import com.datastax.driver.core.exceptions.AuthenticationException;
21-import com.google.common.base.Charsets;
22-import com.google.common.collect.ImmutableMap;
23-
24-import javax.security.auth.Subject;
25-import javax.security.auth.login.LoginContext;
26-import javax.security.auth.login.LoginException;
27-import javax.security.sasl.Sasl;
28-import javax.security.sasl.SaslClient;
29-import javax.security.sasl.SaslException;
30-import java.net.InetSocketAddress;
31-import java.security.PrivilegedActionException;
32-import java.security.PrivilegedExceptionAction;
33-import java.util.Arrays;
34-import java.util.Map;
35-
36-/**
37- * AuthProvider that provides GSSAPI authenticator instances for clients to connect
38- * to DSE clusters secured with the DseAuthenticator.
39- * <p/>
40- * <h1>Kerberos Authentication</h1>
41- * The SASL protocol name defaults to "dse"; should you need to change that
42- * it can be overridden using the <code>dse.sasl.protocol</code> system property.
43- * <p/>
44- * Keytab and ticket cache settings are specified using a standard JAAS
45- * configuration file. The location of the file can be set using the
46- * <code>java.security.auth.login.config</code> system property or by adding a
47- * <code>login.config.url.n</code> entry in the <code>java.security</code> properties
48- * file.
49- * <p/>
50- * See the following documents for further details on the
51- * <a href="https://docs.oracle.com/javase/6/docs/technotes/guides/security/jgss/tutorials/LoginConfigFile.html">JAAS Login Configuration File</a> and the
52- * <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html">JAAS Authentication Tutorial</a>
53- * for more on JAAS in general.
54- * <p/>
55- * <h1>Authentication using ticket cache</h1>
56- * Run <code>kinit</code> to obtain a ticket and populate the cache before
57- * connecting. JAAS config:
58- * <p/>
59- * <pre>
60- * DseClient {
61- * com.sun.security.auth.module.Krb5LoginModule required
62- * useTicketCache=true
63- * renewTGT=true;
64- * };
65- * </pre>
66- * <p/>
67- * <p/>
68- * <h1>Authentication using a keytab file</h1>
69- * To enable authentication using a keytab file, specify its location on disk.
70- * If your keytab contains more than one principal key, you should also specify
71- * which one to select.
72- * <p/>
73- * <pre>
74- * DseClient {
75- * com.sun.security.auth.module.Krb5LoginModule required
76- * useKeyTab=true
77- * keyTab="/path/to/file.keytab"
78- * principal="user@MYDOMAIN.COM";
79- * };
80- * </pre>
81- * To create a cluster using this auth provider:
82- * <pre>
83- * Cluster cluster = Cluster.builder()
84- * .addContactPoint(hostname)
85- * .withAuthProvider(new DseGSSAPIAuthProvider())
86- * .build();
87- * </pre>
88- */
89-public class DseGSSAPIAuthProvider implements AuthProvider {
90- public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException {
91- return new GSSAPIAuthenticator(authenticator, host);
92- }
93-
94- private static class GSSAPIAuthenticator extends BaseDseAuthenticator {
95- private static final String JAAS_CONFIG_ENTRY = "DseClient";
96- private static final String[] SUPPORTED_MECHANISMS = new String[]{"GSSAPI"};
97- private static final String SASL_PROTOCOL_NAME = "dse";
98- private static final String SASL_PROTOCOL_NAME_PROPERTY = "dse.sasl.protocol";
99- private static final Map<String, String> DEFAULT_PROPERTIES =
100- ImmutableMap.<String, String>builder().put(Sasl.SERVER_AUTH, "true")
101- .put(Sasl.QOP, "auth")
102- .build();
103- private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
104- private static final byte[] MECHANISM = "GSSAPI".getBytes(Charsets.UTF_8);
105- private static final byte[] SERVER_INITIAL_CHALLENGE = "GSSAPI-START".getBytes(Charsets.UTF_8);
106-
107- private final Subject subject;
108- private final SaslClient saslClient;
109-
110- public GSSAPIAuthenticator(String authenticator, InetSocketAddress host) {
111- super(authenticator);
112- try {
113- LoginContext login = new LoginContext(JAAS_CONFIG_ENTRY);
114- login.login();
115- subject = login.getSubject();
116- saslClient = Sasl.createSaslClient(SUPPORTED_MECHANISMS,
117- null,
118- System.getProperty(SASL_PROTOCOL_NAME_PROPERTY, SASL_PROTOCOL_NAME),
119- host.getAddress().getCanonicalHostName(),
120- DEFAULT_PROPERTIES,
121- null);
122- } catch (LoginException e) {
123- throw new RuntimeException(e);
124- } catch (SaslException e) {
125- throw new RuntimeException(e);
126- }
127- }
128-
129- public byte[] getMechanism() {
130- return MECHANISM.clone();
131- }
132-
133- public byte[] getInitialServerChallenge() {
134- return SERVER_INITIAL_CHALLENGE.clone();
135- }
136-
137- public byte[] evaluateChallenge(byte[] challenge) {
138- if (Arrays.equals(SERVER_INITIAL_CHALLENGE, challenge)) {
139- if (!saslClient.hasInitialResponse()) {
140- return EMPTY_BYTE_ARRAY;
141- }
142- challenge = EMPTY_BYTE_ARRAY;
143- }
144- final byte[] internalChallenge = challenge;
145- try {
146- return Subject.doAs(subject, new PrivilegedExceptionAction<byte[]>() {
147- public byte[] run() throws SaslException {
148- return saslClient.evaluateChallenge(internalChallenge);
149- }
150- });
151- } catch (PrivilegedActionException e) {
152- throw new RuntimeException(e.getException());
153- }
154- }
155- }
156-}
deleted driver-dse/src/main/java/com/datastax/driver/auth/DsePlainTextAuthProvider.java +0 −87
@@ -1,87 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.auth;
17-
18-import com.datastax.driver.core.AuthProvider;
19-import com.datastax.driver.core.Authenticator;
20-import com.datastax.driver.core.exceptions.AuthenticationException;
21-import com.google.common.base.Charsets;
22-
23-import java.net.InetSocketAddress;
24-import java.util.Arrays;
25-
26-import static com.google.common.base.Preconditions.checkNotNull;
27-
28-/**
29- * AuthProvider that provides plain text authenticator instances for clients to connect
30- * to DSE clusters secured with the DseAuthenticator.
31- * <p/>
32- * To create a cluster using this auth provider:
33- * <pre>
34- * Cluster cluster = Cluster.builder()
35- * .addContactPoint(hostname)
36- * .withAuthProvider(new DsePlainTextAuthProvider("username", "password"))
37- * .build();
38- * </pre>
39- */
40-public class DsePlainTextAuthProvider implements AuthProvider {
41- private final String username;
42- private final String password;
43-
44- public DsePlainTextAuthProvider(String username, String password) {
45- checkNotNull(username, "username cannot be null");
46- checkNotNull(password, "password cannot be null");
47- this.username = username;
48- this.password = password;
49- }
50-
51- public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) throws AuthenticationException {
52- return new PlainTextAuthenticator(authenticator, username, password);
53- }
54-
55- private static class PlainTextAuthenticator extends BaseDseAuthenticator {
56- private static final byte[] MECHANISM = "PLAIN".getBytes(Charsets.UTF_8);
57- private static final byte[] SERVER_INITIAL_CHALLENGE = "PLAIN-START".getBytes(Charsets.UTF_8);
58- private final byte[] username;
59- private final byte[] password;
60-
61- public PlainTextAuthenticator(String authenticator, String username, String password) {
62- super(authenticator);
63- this.username = username.getBytes(Charsets.UTF_8);
64- this.password = password.getBytes(Charsets.UTF_8);
65- }
66-
67- public byte[] getMechanism() {
68- return MECHANISM.clone();
69- }
70-
71- public byte[] getInitialServerChallenge() {
72- return SERVER_INITIAL_CHALLENGE.clone();
73- }
74-
75- public byte[] evaluateChallenge(byte[] challenge) {
76- if (Arrays.equals(SERVER_INITIAL_CHALLENGE, challenge)) {
77- byte[] token = new byte[username.length + password.length + 2];
78- token[0] = 0;
79- System.arraycopy(username, 0, token, 1, username.length);
80- token[username.length + 1] = 0;
81- System.arraycopy(password, 0, token, username.length + 2, password.length);
82- return token;
83- }
84- throw new RuntimeException("Incorrect challenge from server");
85- }
86- }
87-}
modified pom.xml +0 −1
@@ -41,7 +41,6 @@
4141 <module>driver-mapping</module>
4242 <module>driver-extras</module>
4343 <module>driver-examples</module>
44- <module>driver-dse</module>
4544 <module>driver-dist</module>
4645 </modules>
4746