Skip to content

Commit 5b0e081

Browse files
committed
implement tests with LDAP server in Docker
1 parent 09d6383 commit 5b0e081

File tree

32 files changed

+1432
-1145
lines changed

32 files changed

+1432
-1145
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ workflows:
244244
branches:
245245
ignore: /.*/
246246
tags:
247-
only: /^v4.0-beta2-\d+\.\d+\.\d+$/
247+
only: /^v4.0-rc2-\d+\.\d+\.\d+$/
248248
- publish-github-release-2-2:
249249
requires:
250250
- build-2-2
@@ -276,4 +276,4 @@ workflows:
276276
branches:
277277
ignore: /.*/
278278
tags:
279-
only: /^v4.0-beta2-\d+\.\d+\.\d+$/
279+
only: /^v4.0-rc2-\d+\.\d+\.\d+$/

base/pom.xml

Lines changed: 7 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,34 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3-
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
44
<modelVersion>4.0.0</modelVersion>
5-
5+
66
<parent>
77
<groupId>com.instaclustr</groupId>
88
<artifactId>cassandra-ldap-parent</artifactId>
99
<version>1.0.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
12-
12+
1313
<!--
1414
this artifact is reused in both Cassandra 3 and Cassandra 4 if applicable as interfaces are some for
1515
the most of the functionality and respective implementation differ where it is necessary
1616
-->
17-
17+
1818
<artifactId>cassandra-ldap-base</artifactId>
1919
<version>1.1.1</version>
20-
20+
2121
<name>Cassandra LDAP Authenticator common code</name>
2222
<description>Common code for Apache Cassandra LDAP plugin</description>
23-
24-
<properties>
25-
<embedded.cassandra.version>3.0.2</embedded.cassandra.version>
26-
<cassandra.driver.version>4.6.0</cassandra.driver.version>
27-
<testng.version>6.14.3</testng.version>
28-
<version.awaitility>4.0.3</version.awaitility>
29-
<version.instaclustr.common>1.3.7</version.instaclustr.common>
30-
</properties>
31-
23+
3224
<dependencies>
3325
<dependency>
3426
<groupId>org.apache.cassandra</groupId>
3527
<artifactId>cassandra-all</artifactId>
3628
<version>3.0.23</version>
3729
<scope>provided</scope>
3830
</dependency>
39-
40-
<!-- test -->
41-
42-
<dependency>
43-
<groupId>com.github.nosan</groupId>
44-
<artifactId>embedded-cassandra</artifactId>
45-
<version>${embedded.cassandra.version}</version>
46-
<scope>test</scope>
47-
<exclusions>
48-
<exclusion>
49-
<groupId>com.datastax.oss</groupId>
50-
<artifactId>java-driver-core</artifactId>
51-
</exclusion>
52-
</exclusions>
53-
</dependency>
54-
55-
<dependency>
56-
<groupId>com.datastax.cassandra</groupId>
57-
<artifactId>cassandra-driver-core</artifactId>
58-
<version>3.10.0</version>
59-
<scope>test</scope>
60-
</dependency>
61-
62-
<dependency>
63-
<groupId>org.testng</groupId>
64-
<artifactId>testng</artifactId>
65-
<version>${testng.version}</version>
66-
<scope>test</scope>
67-
</dependency>
68-
69-
<dependency>
70-
<groupId>org.awaitility</groupId>
71-
<artifactId>awaitility</artifactId>
72-
<version>${version.awaitility}</version>
73-
<scope>test</scope>
74-
</dependency>
7531
</dependencies>
76-
77-
<build>
78-
<plugins>
79-
<plugin>
80-
<groupId>org.apache.maven.plugins</groupId>
81-
<artifactId>maven-jar-plugin</artifactId>
82-
<version>${maven.jar.plugin.version}</version>
83-
<executions>
84-
<execution>
85-
<goals>
86-
<goal>test-jar</goal>
87-
</goals>
88-
</execution>
89-
</executions>
90-
</plugin>
91-
</plugins>
92-
</build>
9332

9433
</project>
9534

base/src/main/java/com/instaclustr/cassandra/ldap/conf/LdapAuthenticatorConfiguration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ public Properties parseProperties() throws ConfigurationException
139139

140140
properties.setProperty(FILTER_TEMPLATE, filterTemplate);
141141

142-
143-
144142
properties.put(LdapAuthenticatorConfiguration.CONTEXT_FACTORY_PROP, properties.getProperty(CONTEXT_FACTORY_PROP, DEFAULT_CONTEXT_FACTORY));
145143
properties.put(LdapAuthenticatorConfiguration.LDAP_URI_PROP, properties.getProperty(LDAP_URI_PROP));
146144

base/src/main/java/org/apache/cassandra/auth/LDAPCassandraRoleManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public void setup()
9494

9595
if (!canLogin(RoleResource.fromName("roles/" + dbaRole)))
9696
{
97+
if (dbaRole.equals("cassandra"))
98+
{
99+
throw new IllegalStateException();
100+
}
97101
logger.info("Role '" + dbaRole + "' can not log in, prematurely existing setup, not going to create LDAP admin role {}", ldapAdminRole);
98102
return null;
99103
}

0 commit comments

Comments
 (0)