diff --git a/pom.xml b/pom.xml index 93a30615b0..dbaf2b603e 100644 --- a/pom.xml +++ b/pom.xml @@ -190,6 +190,7 @@ true true true + true true true true @@ -1270,6 +1271,7 @@ false false false + false false false true diff --git a/tests/integration-tests-isolated/pom.xml b/tests/integration-tests-isolated/pom.xml new file mode 100644 index 0000000000..d674439e18 --- /dev/null +++ b/tests/integration-tests-isolated/pom.xml @@ -0,0 +1,464 @@ + + + 4.0.0 + + + org.apache.activemq.tests + artemis-tests-pom + 2.29.0-SNAPSHOT + + + integration-tests-isolated + jar + ActiveMQ Artemis Isolated Integration Tests + This project is pretty much a copy of integration-tests however the tests here will run with fork=always, isolating each test on its own VM. + + + ${project.basedir}/../.. + + + + + + org.apache.activemq + artemis-quorum-ri + ${project.version} + test + + + org.apache.activemq.tests + unit-tests + ${project.version} + test + test-jar + + + org.apache.activemq + artemis-jms-client + ${project.version} + + + org.apache.activemq + artemis-jms-server + ${project.version} + + + org.apache.activemq + artemis-ra + ${project.version} + + + org.apache.activemq + artemis-cli + ${project.version} + + + org.apache.activemq + artemis-commons + ${project.version} + + + org.apache.activemq + artemis-spring-integration + ${project.version} + + + org.apache.activemq + artemis-journal + ${project.version} + + + org.apache.activemq + artemis-jdbc-store + ${project.version} + + + org.apache.activemq + artemis-amqp-protocol + ${project.version} + + + org.apache.activemq + artemis-stomp-protocol + ${project.version} + + + org.apache.activemq + artemis-openwire-protocol + ${project.version} + + + org.apache.geronimo.specs + geronimo-jms_1.1_spec + + + + + org.apache.activemq + artemis-hornetq-protocol + ${project.version} + + + org.apache.activemq + artemis-core-client + ${project.version} + + + org.apache.activemq + artemis-server + ${project.version} + + + org.apache.activemq + activemq-artemis-native + ${activemq-artemis-native-version} + + + org.apache.activemq + artemis-service-extensions + ${project.version} + + + org.apache.activemq.tests + artemis-test-support + ${project.version} + + + org.apache.activemq + artemis-junit + ${project.version} + test + + + org.apache.activemq + artemis-unit-test-support + ${project.version} + test + + + org.hamcrest + hamcrest + ${hamcrest.version} + test + + + + org.apache.activemq + activemq-client + test + + + org.apache.geronimo.specs + geronimo-jms_1.1_spec + + + org.apache.geronimo.specs + geronimo-j2ee-management_1.1_spec + + + + + org.apache.activemq + artemis-mqtt-protocol + ${project.version} + + + org.fusesource.mqtt-client + mqtt-client + + + org.eclipse.paho + org.eclipse.paho.client.mqttv3 + + + org.eclipse.paho + org.eclipse.paho.mqttv5.client + + + jakarta.resource + jakarta.resource-api + + + jakarta.transaction + jakarta.transaction-api + + + jakarta.jms + jakarta.jms-api + + + jakarta.management.j2ee + jakarta.management.j2ee-api + + + jakarta.annotation + jakarta.annotation-api + + + io.netty + netty-buffer + + + io.netty + netty-codec-http + + + io.netty + netty-codec-mqtt + ${netty.version} + + + io.netty + netty-handler + + + io.netty + netty-transport + + + junit + junit + + + org.apache.qpid + qpid-jms-client + + + org.apache.qpid + proton-j + + + + org.slf4j + slf4j-api + + + org.apache.logging.log4j + log4j-slf4j-impl + test + + + org.apache.activemq + artemis-web + ${project.version} + test + + + + + org.apache.derby + derby + test + + + org.postgresql + postgresql + test + + + org.apache.directory.server + apacheds-test-framework + ${directory-version} + test + + + org.apache.directory.api + api-ldap-schema-data + + + + + org.apache.directory.server + apacheds-server-annotations + ${directory-version} + test + + + org.apache.commons + commons-lang3 + test + + + + org.codehaus.woodstox + woodstox-core-asl + 4.4.0 + test + + + javax.xml.stream + stax-api + + + + + org.apache.hadoop + hadoop-minikdc + test + + + org.apache.directory.server + apacheds-interceptor-kerberos + ${directory-version} + test + + + org.apache.directory.jdbm + apacheds-jdbm2 + ${directory-jdbm2-version} + test + + + org.springframework + spring-context + test + + + org.springframework + spring-jms + test + + + commons-io + commons-io + + + org.jgroups + jgroups + + + + + io.netty + netty-tcnative-boringssl-static + ${netty-tcnative-version} + + + + io.vertx + vertx-proton + ${vertx.version} + test + + + + + org.apache.activemq + activemq-broker + ${activemq5-version} + test + + + com.fasterxml.jackson.core + jackson-databind + + + + + + + org.apache.johnzon + johnzon-core + test + + + jakarta.json + jakarta.json-api + test + + + + org.mockito + mockito-core + test + + + + + + + + src/test/resources + true + + + + + maven-resources-plugin + + + jks + + + + + copy-security-resources + validate + + copy-resources + + + ${basedir}/target/test-classes + + + ../security-resources + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + test + + test-jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + always + ${skipIsolatedIntegrationTests} + -Djgroups.bind_addr=::1 ${activemq-surefire-argline} ${its-surefire-extra-args} -Dorg.apache.activemq.SERIALIZABLE_PACKAGES="java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf" + + + + + + + jdk16on + + [16,) + + + --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED + + + + + diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalLDAPTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/JMSSaslExternalLDAPTest.java similarity index 97% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalLDAPTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/JMSSaslExternalLDAPTest.java index 7e109732aa..99acf6faf5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSSaslExternalLDAPTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/JMSSaslExternalLDAPTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.amqp; +package org.apache.activemq.artemis.tests.integration.isolated.amqp; import javax.jms.Connection; import javax.jms.MessageConsumer; @@ -69,7 +69,7 @@ public class JMSSaslExternalLDAPTest extends AbstractLdapTestUnit { static { String path = System.getProperty("java.security.auth.login.config"); if (path == null) { - URL resource = JMSSaslExternalTest.class.getClassLoader().getResource("login.config"); + URL resource = JMSSaslExternalLDAPTest.class.getClassLoader().getResource("login.config"); if (resource != null) { path = resource.getFile(); System.setProperty("java.security.auth.login.config", path); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/SaslKrb5LDAPSecurityTest.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/SaslKrb5LDAPSecurityTest.java index 905f15d89a..d7fea9fbc7 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/SaslKrb5LDAPSecurityTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/amqp/SaslKrb5LDAPSecurityTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.amqp; +package org.apache.activemq.artemis.tests.integration.isolated.amqp; import javax.jms.Connection; import javax.jms.MessageConsumer; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LDAPSecurityTest.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LDAPSecurityTest.java index 77f230258c..face4455de 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LDAPSecurityTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LDAPSecurityTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import javax.naming.Context; import javax.naming.NameClassPair; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest.java index 116608231c..7343d3e08e 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import javax.naming.Context; import javax.naming.NameClassPair; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest2.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest2.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest2.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest2.java index 19698b7cdc..19f47b9a73 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginListenerTest2.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginListenerTest2.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import javax.naming.Context; import javax.naming.NamingException; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginRefreshTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginRefreshTest.java similarity index 94% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginRefreshTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginRefreshTest.java index bf99aa32c0..49da370d8a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginRefreshTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginRefreshTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import java.util.Map; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest.java index 89ba895dd2..0b4eefda52 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import javax.jms.Connection; import javax.jms.ConnectionFactory; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest2.java b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest2.java similarity index 99% rename from tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest2.java rename to tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest2.java index 69b4a93b6d..071b6b3369 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/security/LegacyLDAPSecuritySettingPluginTest2.java +++ b/tests/integration-tests-isolated/src/test/java/org/apache/activemq/artemis/tests/integration/isolated/security/LegacyLDAPSecuritySettingPluginTest2.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.activemq.artemis.tests.integration.security; +package org.apache.activemq.artemis.tests.integration.isolated.security; import javax.naming.Context; import javax.naming.NameClassPair; diff --git a/tests/integration-tests/src/test/resources/AMQauth.ldif b/tests/integration-tests-isolated/src/test/resources/AMQauth.ldif similarity index 100% rename from tests/integration-tests/src/test/resources/AMQauth.ldif rename to tests/integration-tests-isolated/src/test/resources/AMQauth.ldif diff --git a/tests/integration-tests/src/test/resources/AMQauth2.ldif b/tests/integration-tests-isolated/src/test/resources/AMQauth2.ldif similarity index 100% rename from tests/integration-tests/src/test/resources/AMQauth2.ldif rename to tests/integration-tests-isolated/src/test/resources/AMQauth2.ldif diff --git a/tests/integration-tests/src/test/resources/AMQauth3.ldif b/tests/integration-tests-isolated/src/test/resources/AMQauth3.ldif similarity index 100% rename from tests/integration-tests/src/test/resources/AMQauth3.ldif rename to tests/integration-tests-isolated/src/test/resources/AMQauth3.ldif diff --git a/tests/integration-tests/src/test/resources/SaslKrb5LDAPSecurityTest.ldif b/tests/integration-tests-isolated/src/test/resources/SaslKrb5LDAPSecurityTest.ldif similarity index 100% rename from tests/integration-tests/src/test/resources/SaslKrb5LDAPSecurityTest.ldif rename to tests/integration-tests-isolated/src/test/resources/SaslKrb5LDAPSecurityTest.ldif diff --git a/tests/integration-tests-isolated/src/test/resources/login.config b/tests/integration-tests-isolated/src/test/resources/login.config new file mode 100644 index 0000000000..63f5978f8e --- /dev/null +++ b/tests/integration-tests-isolated/src/test/resources/login.config @@ -0,0 +1,386 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +PropertiesLogin { + org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required + debug=true + org.apache.activemq.jaas.properties.user="users.properties" + org.apache.activemq.jaas.properties.role="roles.properties"; +}; + +PropertiesLoginWithPasswordCodec { + org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required + debug=true + org.apache.activemq.jaas.properties.user="users.properties" + org.apache.activemq.jaas.properties.role="roles.properties" + org.apache.activemq.jaas.properties.password.codec="org.apache.activemq.artemis.tests.integration.security.SecurityTest$DummySensitiveDataCodec"; +}; + +LDAPLogin { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword=secret + connectionProtocol=s + authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=cn + roleSearchMatching="(member=uid={1},ou=system)" + roleSearchSubtree=false + ; +}; + +LDAPLogin2 { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword=secret + connectionProtocol=s + authentication=simple + userBase="ou=User,ou=ActiveMQ,o=example,ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=true + roleBase="ou=Group,ou=ActiveMQ,o=example,ou=system" + roleName=cn + roleSearchMatching="(member=uid={1})" + roleSearchSubtree=true + ; +}; + +UnAuthenticatedLDAPLogin { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword="" + connectionProtocol=s + authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=dummyRoleName + roleSearchMatching="(uid={1})" + roleSearchSubtree=false + ; +}; + +BrokenLDAPLoginNamingException { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword="" + connectionProtocol=s + authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=dummyRoleName + roleSearchMatching="(uid={1})" + roleSearchSubtree=false + noCacheExceptions="javax.naming.NamingException" + ; +}; + +BrokenLDAPLoginConnectException { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword="123" + connectionProtocol=s + authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=dummyRoleName + roleSearchMatching="(uid={1})" + roleSearchSubtree=false + noCacheExceptions="javax.naming.NamingException, java.net.ConnectException" + ; +}; + +ExpandedLDAPLogin { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword=secret + connectionProtocol=s + authentication=simple + userBase="ou=system" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleBase="ou=system" + roleName=cn + roleSearchMatching="(uid={1})" + roleSearchSubtree=false + expandRoles=true + expandRolesMatching="(member={0})" + ; +}; + +LDAPLogin3 { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword=secret + connectionProtocol=s + authentication=simple + userBase="ou=users,dc=example,dc=com" + userSearchMatching="(uid={0})" + userSearchSubtree=true + roleBase="ou=roles,dc=example,dc=com" + roleName=cn + roleSearchMatching="(uniqueMember={0})" + roleSearchSubtree=true + connectionPool=true + connectionTimeout="5000" + ; +}; + +GuestLogin { + org.apache.activemq.artemis.spi.core.security.jaas.GuestLoginModule required + debug=true + org.apache.activemq.jaas.guest.user="foo" + org.apache.activemq.jaas.guest.role="bar"; + +}; + +GuestLoginWithDefaults { + org.apache.activemq.artemis.spi.core.security.jaas.GuestLoginModule required + debug=true; +}; + +OpenLdapConfiguration { + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule required + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:389" + connectionUsername="cn=mqbroker,ou=Services,ou=system,dc=fusesource,dc=com" + connectionPassword="sunflower" + connectionProtocol="s" + topicSearchMatchingFormat="cn={0},ou=Topic,ou=Destination,ou=ActiveMQ,ou=system,dc=fusesource,dc=com" + topicSearchSubtreeBool=true + authentication=simple + userBase="ou=User,ou=ActiveMQ,ou=system,dc=fusesource,dc=com" + userSearchMatching="(uid={0})" + userSearchSubtree=false + roleSearchMatching="(uid={1})" + queueSearchMatchingFormat="cn={0},ou=Queue,ou=Destination,ou=ActiveMQ,ou=system,dc=fusesource,dc=com" + queueSearchSubtreeBool=true + roleBase="ou=Group,ou=ActiveMQ,ou=system,dc=fusesource,dc=com" + roleName=cn + roleSearchMatching="(member:=uid={1})" + roleSearchSubtree=true + ; +}; + +CertLogin { + org.apache.activemq.artemis.spi.core.security.jaas.TextFileCertificateLoginModule required + debug=true + org.apache.activemq.jaas.textfiledn.user="cert-users.properties" + org.apache.activemq.jaas.textfiledn.role="cert-roles.properties"; +}; + +CertLoginWithRegexp { + org.apache.activemq.artemis.spi.core.security.jaas.TextFileCertificateLoginModule required + debug=true + org.apache.activemq.jaas.textfiledn.user="cert-regexps.properties" + org.apache.activemq.jaas.textfiledn.role="cert-roles.properties"; +}; + +DualAuthenticationCertLogin { + org.apache.activemq.artemis.spi.core.security.jaas.TextFileCertificateLoginModule required + debug=true + org.apache.activemq.jaas.textfiledn.user="dual-authentication-cert-users.properties" + org.apache.activemq.jaas.textfiledn.role="dual-authentication-cert-roles.properties"; +}; + +DualAuthenticationPropertiesLogin { + org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule required + debug=true + org.apache.activemq.jaas.properties.user="dual-authentication-users.properties" + org.apache.activemq.jaas.properties.role="dual-authentication-roles.properties"; +}; + +Krb5Plus { + + org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule optional + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.PropertiesLoginModule optional + debug=true + org.apache.activemq.jaas.properties.user="dual-authentication-users.properties" + org.apache.activemq.jaas.properties.role="dual-authentication-roles.properties"; +}; + +SaslExternalPlusLdap { + + org.apache.activemq.artemis.spi.core.security.jaas.ExternalCertificateLoginModule required + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + connectionUsername="uid=admin,ou=system" + connectionPassword=secret + connectionProtocol=s + authentication=simple + authenticateUser=false + roleBase="ou=system" + roleName=cn + roleSearchMatching="(member=uid={1})" + ; +}; + +Krb5PlusLdap { + + org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule required + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + authentication=GSSAPI + saslLoginConfigScope=broker-sasl-gssapi + connectionProtocol=s + userBase="ou=users,dc=example,dc=com" + userSearchMatching="(krb5PrincipalName={0})" + userSearchSubtree=true + authenticateUser=false + roleBase="ou=system" + roleName=cn + roleSearchMatching="(member={0})" + roleSearchSubtree=false + ; +}; + +Krb5PlusLdapNoRoleName { + + org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule required + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + authentication=GSSAPI + saslLoginConfigScope=broker-sasl-gssapi + connectionProtocol=s + userBase="ou=users,dc=example,dc=com" + userSearchMatching="(krb5PrincipalName={0})" + userSearchSubtree=true + authenticateUser=false + roleBase="ou=system" + roleSearchMatching="(member={0})" + roleSearchSubtree=false + ; +}; + +Krb5PlusLdapMemberOf { + + org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule required + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + authentication=GSSAPI + saslLoginConfigScope=broker-sasl-gssapi + connectionProtocol=s + userBase="ou=users,dc=example,dc=com" + userSearchMatching="(krb5PrincipalName={0})" + userSearchSubtree=true + authenticateUser=false + userRoleName=businessCategory + roleName=cn + ; +}; + +Krb5PlusLdapMemberOfNoRoleName { + + org.apache.activemq.artemis.spi.core.security.jaas.Krb5LoginModule required + debug=true; + + org.apache.activemq.artemis.spi.core.security.jaas.LDAPLoginModule optional + debug=true + initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory + connectionURL="ldap://localhost:1024" + authentication=GSSAPI + saslLoginConfigScope=broker-sasl-gssapi + connectionProtocol=s + userBase="ou=users,dc=example,dc=com" + userSearchMatching="(krb5PrincipalName={0})" + userSearchSubtree=true + authenticateUser=false + userRoleName=businessCategory + ; +}; + +amqp-sasl-gssapi { + com.sun.security.auth.module.Krb5LoginModule required + isInitiator=false + storeKey=true + useKeyTab=true + principal="amqp/localhost" + debug=true; +}; + +broker-sasl-gssapi { + com.sun.security.auth.module.Krb5LoginModule required + isInitiator=true + storeKey=true + useKeyTab=true + principal="amqp/localhost" + debug=true; +}; + +amqp-jms-client { + com.sun.security.auth.module.Krb5LoginModule required + useKeyTab=true; +}; + +amqp-sasl-scram { + org.apache.activemq.artemis.spi.core.security.jaas.SCRAMPropertiesLoginModule required + debug=false + org.apache.activemq.jaas.properties.user="artemis-scram-users.properties" + org.apache.activemq.jaas.properties.role="artemis-scram-roles.properties"; +}; + +artemis-sasl-scram { + org.apache.activemq.artemis.spi.core.security.jaas.SCRAMLoginModule required + ; +}; diff --git a/tests/integration-tests-isolated/src/test/resources/minikdc-krb5-template.conf b/tests/integration-tests-isolated/src/test/resources/minikdc-krb5-template.conf new file mode 100644 index 0000000000..1d08811ce8 --- /dev/null +++ b/tests/integration-tests-isolated/src/test/resources/minikdc-krb5-template.conf @@ -0,0 +1,30 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +[libdefaults] + kdc_realm = EXAMPLE.COM + default_realm = EXAMPLE.COM + udp_preference_limit = 1 + kdc_tcp_port = MINI_KDC_PORT + default_keytab_name = FILE:target/test.krb5.keytab + +[realms] + EXAMPLE.COM = { + kdc = localhost:MINI_KDC_PORT + } + diff --git a/tests/integration-tests-isolated/src/test/resources/minikdc-krb5.conf b/tests/integration-tests-isolated/src/test/resources/minikdc-krb5.conf new file mode 100644 index 0000000000..0f068ca44c --- /dev/null +++ b/tests/integration-tests-isolated/src/test/resources/minikdc-krb5.conf @@ -0,0 +1,26 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +[libdefaults] + default_realm = {0} + udp_preference_limit = 1 + default_keytab_name = FILE:target/test.krb5.keytab + +[realms] + {0} = '{' + kdc = {1}:{2} + '}' \ No newline at end of file diff --git a/tests/integration-tests/pom.xml b/tests/integration-tests/pom.xml index d1d9ac3896..cfa4bd877d 100644 --- a/tests/integration-tests/pom.xml +++ b/tests/integration-tests/pom.xml @@ -269,24 +269,7 @@ postgresql test - - org.apache.directory.server - apacheds-test-framework - ${directory-version} - test - - - org.apache.directory.api - api-ldap-schema-data - - - - - org.apache.directory.server - apacheds-server-annotations - ${directory-version} - test - + org.apache.commons commons-lang3 @@ -310,18 +293,6 @@ hadoop-minikdc test - - org.apache.directory.server - apacheds-interceptor-kerberos - ${directory-version} - test - - - org.apache.directory.jdbm - apacheds-jdbm2 - ${directory-jdbm2-version} - test - org.springframework spring-context diff --git a/tests/pom.xml b/tests/pom.xml index d29feed0f8..0071117cb6 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -130,6 +130,7 @@ timing-tests jms-tests integration-tests + integration-tests-isolated karaf-client-integration-tests karaf-server-integration-tests compatibility-tests