From 4b6c0f4ea88eb151a1909e222ee1a3b837a4b00e Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Thu, 16 Jun 2022 12:50:58 +0200 Subject: [PATCH 1/4] add WildFly 25 --- README.md | 23 +++++++ .../extras/creaper/core/ServerVersion.java | 5 +- .../creaper/core/ServerVersionTest.java | 2 + .../offline/OfflineServerVersionTest.java | 16 +++++ testsuite/pom.xml | 63 ++++++++++++++++++- 5 files changed, 105 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 66548976..d60a8ba5 100644 --- a/README.md +++ b/README.md @@ -427,6 +427,29 @@ Dependencies for `creaper-commands`: 16.0.1.Final +#### WildFly 25 (25.0.1) (based on WildFly Core 17) + +Dependencies for `creaper-core`: + + + org.wildfly.core + wildfly-controller-client + 17.0.3.Final + + + org.wildfly.core + wildfly-cli + 17.0.3.Final + + +Dependencies for `creaper-commands`: + + + org.wildfly.core + wildfly-patching + 17.0.3.Final + + ### Transitive Dependencies These are the dependencies that you will get transitively when you depend diff --git a/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java b/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java index 00fdc52c..9e57b12c 100644 --- a/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java +++ b/core/src/main/java/org/wildfly/extras/creaper/core/ServerVersion.java @@ -92,6 +92,8 @@ public final class ServerVersion { public static final ServerVersion VERSION_16_0_0 = new ServerVersion(16, 0, 0); /** WF 24.0.x.Final */ public static final ServerVersion VERSION_17_0_0 = new ServerVersion(17, 0, 0); + /** WF 25.0.x.Final */ + public static final ServerVersion VERSION_18_0_0 = new ServerVersion(18, 0, 0); private static final ServerVersion[] KNOWN_VERSIONS = { VERSION_0_0_0, @@ -122,7 +124,8 @@ public final class ServerVersion { VERSION_14_0_0, VERSION_15_0_0, VERSION_16_0_0, - VERSION_17_0_0 + VERSION_17_0_0, + VERSION_18_0_0 }; /** diff --git a/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java b/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java index 0659bb6f..da046dbc 100644 --- a/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java +++ b/core/src/test/java/org/wildfly/extras/creaper/core/ServerVersionTest.java @@ -40,6 +40,7 @@ public void referenceEquality() { assertSame(ServerVersion.VERSION_15_0_0, ServerVersion.from(15, 0, 0)); assertSame(ServerVersion.VERSION_16_0_0, ServerVersion.from(16, 0, 0)); assertSame(ServerVersion.VERSION_17_0_0, ServerVersion.from(17, 0, 0)); + assertSame(ServerVersion.VERSION_18_0_0, ServerVersion.from(18, 0, 0)); assertNotSame(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42)); } @@ -75,6 +76,7 @@ public void equality() { assertSame(ServerVersion.VERSION_15_0_0, ServerVersion.from(15, 0, 0)); assertSame(ServerVersion.VERSION_16_0_0, ServerVersion.from(16, 0, 0)); assertSame(ServerVersion.VERSION_17_0_0, ServerVersion.from(17, 0, 0)); + assertSame(ServerVersion.VERSION_18_0_0, ServerVersion.from(18, 0, 0)); assertEquals(ServerVersion.from(42, 42, 42), ServerVersion.from(42, 42, 42)); } diff --git a/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java b/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java index 4554283b..96deff53 100644 --- a/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java +++ b/core/src/test/java/org/wildfly/extras/creaper/core/offline/OfflineServerVersionTest.java @@ -61,6 +61,7 @@ public class OfflineServerVersionTest { private static final String WFLY22_ROOT = "15.0"; private static final String WFLY23_ROOT = "16.0"; private static final String WFLY24_ROOT = "17.0"; + private static final String WFLY25_ROOT = "18.0"; @Rule public final TemporaryFolder tmp = new TemporaryFolder(); @@ -170,6 +171,11 @@ public void discoverStandaloneXml_wfly24() throws IOException { test(ServerVersion.VERSION_17_0_0, STANDALONE_XML, WFLY24_ROOT, EAP7_LOGGING, EAP7_EE); } + @Test + public void discoverStandaloneXml_wfly25() throws IOException { + test(ServerVersion.VERSION_18_0_0, STANDALONE_XML, WFLY25_ROOT, EAP7_LOGGING, EAP7_EE); + } + @Test public void discoverHostXml_eap6() throws IOException { test(ServerVersion.VERSION_1_7_0, HOST_XML, EAP6_ROOT, EAP6_LOGGING, EAP6_EE); @@ -250,6 +256,11 @@ public void discoverHostXml_wfly24() throws IOException { test(ServerVersion.VERSION_17_0_0, HOST_XML, WFLY24_ROOT, EAP7_LOGGING, EAP7_EE); } + @Test + public void discoverHostXml_wfly25() throws IOException { + test(ServerVersion.VERSION_18_0_0, HOST_XML, WFLY25_ROOT, EAP7_LOGGING, EAP7_EE); + } + @Test public void discoverDomainXml_eap6() throws IOException { test(ServerVersion.VERSION_1_7_0, DOMAIN_XML, EAP6_ROOT, EAP6_LOGGING, EAP6_EE); @@ -330,6 +341,11 @@ public void discoverDomainXml_wfly24() throws IOException { test(ServerVersion.VERSION_17_0_0, DOMAIN_XML, WFLY24_ROOT, EAP7_LOGGING, EAP7_EE); } + @Test + public void discoverDomainXml_wfly25() throws IOException { + test(ServerVersion.VERSION_18_0_0, DOMAIN_XML, WFLY25_ROOT, EAP7_LOGGING, EAP7_EE); + } + private void test(ServerVersion expected, String xmlPattern, String rootVersion, String loggingVersion, String eeVersion) throws IOException { String xml = xmlPattern diff --git a/testsuite/pom.xml b/testsuite/pom.xml index e3a9c474..0b939f4c 100644 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -65,6 +65,9 @@ 24.0.1.Final 16.0.1.Final 3.0.1.Final + 25.0.1.Final + 17.0.3.Final + 3.0.1.Final 9990 @@ -179,6 +182,13 @@ wildfly-arquillian-container-managed ${version.wildfly24.arquillian} + org.wildfly + wildfly-dist + ${version.wildfly25} + org.wildfly.arquillian + wildfly-arquillian-container-managed + ${version.wildfly25.arquillian} + MUST-BE-DEFINED @@ -1034,9 +1044,6 @@ wildfly24 - - true - 1.8 @@ -1082,5 +1089,55 @@ + + wildfly25 + + true + + + + 1.8 + + ${wildfly25.applicationServer.groupId} + ${wildfly25.applicationServer.artifactId} + ${wildfly25.applicationServer.version} + ${managementPort.wildfly} + + ${wildfly25.arquillianContainer.groupId} + ${wildfly25.arquillianContainer.artifactId} + ${wildfly25.arquillianContainer.version} + + ${ignoredCategory.wildfly11} + ${specialJvmArgs.wildfly} + + + + + org.wildfly.extras.creaper + creaper-core + + + org.wildfly.extras.creaper + creaper-commands + + + + org.wildfly.core + wildfly-controller-client + ${version.wildfly25.core} + + + org.wildfly.core + wildfly-cli + ${version.wildfly25.core} + + + org.wildfly.core + wildfly-patching + ${version.wildfly25.core} + + + + From 6d41cc7377a80377420b5a4d71058d256b36eb2b Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Wed, 4 Jan 2023 19:34:55 +0100 Subject: [PATCH 2/4] fix HttpOnlineManagementClientTest with WildFly 25 --- .../HttpOnlineManagementClientTest.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/core/online/HttpOnlineManagementClientTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/core/online/HttpOnlineManagementClientTest.java index 32799ddf..0c8aee65 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/core/online/HttpOnlineManagementClientTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/core/online/HttpOnlineManagementClientTest.java @@ -10,9 +10,11 @@ import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineManagementClient; import org.wildfly.extras.creaper.core.offline.OfflineOptions; +import org.wildfly.extras.creaper.core.online.operations.admin.Administration; import java.io.File; import java.io.IOException; +import java.util.concurrent.TimeoutException; import static org.junit.Assume.assumeTrue; @@ -20,9 +22,12 @@ public class HttpOnlineManagementClientTest extends OnlineManagementClientTest { private static final String USERNAME = "testuser"; private static final String PASSWORD = "testpass"; private static OfflineManagementClient offlineClient; + private static OnlineManagementClient nativeOnlineClient; @BeforeClass - public static void addUser() throws IOException, CommandFailedException { + public static void addUser() throws IOException, CommandFailedException, CliException, InterruptedException, + TimeoutException { + // first add user offlineClient = ManagementClient.offline(OfflineOptions.standalone() .rootDirectory(new File("target/jboss-as")) .configurationFile("standalone.xml") @@ -30,10 +35,25 @@ public static void addUser() throws IOException, CommandFailedException { ); offlineClient.apply(PropertiesFileAuth.mgmtUsers().defineUser(USERNAME, PASSWORD)); + + if (offlineClient.version().greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + // then enable http authentication, so we can use http protocol + nativeOnlineClient = ManagementClient.online(OnlineOptions.standalone() + .localDefault() + .build()); + nativeOnlineClient.executeCli("security enable-http-auth-management --no-reload"); + new Administration(nativeOnlineClient).reload(); + } } @AfterClass - public static void removeUser() throws CommandFailedException { + public static void removeUser() throws CommandFailedException, CliException, IOException, InterruptedException, + TimeoutException { + if (offlineClient.version().greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + nativeOnlineClient.executeCli("security disable-http-auth-management --no-reload"); + new Administration(nativeOnlineClient).reload(); + } + offlineClient.apply(PropertiesFileAuth.mgmtUsers().undefineUser(USERNAME)); } From 4d4d623bd932b9e96f92c0285395ecc3330fc339 Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Wed, 4 Jan 2023 19:43:50 +0100 Subject: [PATCH 3/4] skip tests that require legacy security on WildFly 25 and above --- .../security/AddAuthorizationModuleOnlineTest.java | 12 ++++++++++++ .../security/AddLoginModuleOnlineTest.java | 12 ++++++++++++ .../security/AddMappingModuleOnlineTest.java | 12 ++++++++++++ .../security/AddSecurityDomainOnlineTest.java | 12 ++++++++++++ .../RemoveAuthorizationModuleOnlineTest.java | 14 +++++++++++++- .../security/RemoveLoginModuleOnlineTest.java | 14 +++++++++++++- .../security/RemoveMappingModuleOnlineTest.java | 14 +++++++++++++- .../security/RemoveSecurityDomainOnlineTest.java | 12 ++++++++++++ .../realms/AddJaasAuthenticationOnlineTest.java | 11 +++++++++++ .../AddKerberosAuthenticationOnlineTest.java | 2 ++ .../realms/AddLdapAuthenticationOnlineTest.java | 11 +++++++++++ .../realms/AddLdapAuthorizationOnlineTest.java | 12 +++++++++++- .../realms/AddLdapConnectionOnlineTest.java | 12 ++++++++++++ .../realms/AddLocalAuthenticationOnlineTest.java | 12 ++++++++++++ .../AddPropertiesAuthenticationOnlineTest.java | 12 ++++++++++++ .../AddPropertiesAuthorizationOnlineTest.java | 12 ++++++++++++ .../realms/AddSecretAuthenticationOnlineTest.java | 12 ++++++++++++ .../realms/AddSecurityRealmOnlineTest.java | 12 ++++++++++++ .../realms/AddSslServerIdentityOnlineTest.java | 11 +++++++++++ .../AddTruststoreAuthenticationOnlineTest.java | 12 ++++++++++++ .../realms/RemoveLdapConnectionOnlineTest.java | 12 ++++++++++++ .../realms/RemoveSecurityRealmOnlineTest.java | 12 ++++++++++++ .../undertow/AddUndertowListenerOnlineTest.java | 4 ++++ 23 files changed, 257 insertions(+), 4 deletions(-) diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModuleOnlineTest.java index d7e0f700..09b7294c 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModuleOnlineTest.java @@ -7,11 +7,14 @@ import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -44,6 +47,15 @@ public class AddAuthorizationModuleOnlineTest { private static final Address TEST_AUTHORIZATION_MODULE_ADDRESS_2 = TEST_AUTHZ_CLASSIC_ADDRESS .and("policy-module", TEST_AUTHORIZATION_MODULE_NAME_2); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddLoginModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddLoginModuleOnlineTest.java index b50d33c4..d7317c8b 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddLoginModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddLoginModuleOnlineTest.java @@ -7,10 +7,13 @@ import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -44,6 +47,15 @@ public class AddLoginModuleOnlineTest { private static final Address TEST_LOGIN_MODULE_ADDRESS_2 = TEST_AUTHN_CLASSIC_ADDRESS .and("login-module", TEST_LOGIN_MODULE_NAME_2); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddMappingModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddMappingModuleOnlineTest.java index a4a34633..9b1af678 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddMappingModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddMappingModuleOnlineTest.java @@ -7,11 +7,14 @@ import org.jboss.dmr.ModelNode; import org.jboss.dmr.Property; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -44,6 +47,15 @@ public class AddMappingModuleOnlineTest { private static final Address TEST_MAPPING_MODULE_ADDRESS_2 = TEST_MAPPING_CLASSIC_ADDRESS .and("mapping-module", TEST_MAPPING_MODULE_NAME_2); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomainOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomainOnlineTest.java index fd410a89..c5e241ce 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomainOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomainOnlineTest.java @@ -5,10 +5,13 @@ import org.jboss.arquillian.junit.Arquillian; import org.junit.After; import org.junit.Assert; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -33,6 +36,15 @@ public class AddSecurityDomainOnlineTest { private static final Address TEST_SECURITY_DOMAIN_ADDRESS = Address.subsystem("security").and("security-domain", TEST_SECURITY_DOMAIN_NAME); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModuleOnlineTest.java index 9ed7825d..af8e7456 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModuleOnlineTest.java @@ -4,11 +4,15 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -16,7 +20,6 @@ import org.wildfly.extras.creaper.core.online.operations.OperationException; import org.wildfly.extras.creaper.core.online.operations.Operations; import org.wildfly.extras.creaper.core.online.operations.admin.Administration; -import org.junit.Ignore; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -60,6 +63,15 @@ public class RemoveAuthorizationModuleOnlineTest { .addModuleOption("delegateMap", "delegateMapValue") .build(); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException, CommandFailedException, OperationException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModuleOnlineTest.java index bd1f8932..fec7dc41 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModuleOnlineTest.java @@ -4,11 +4,15 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -16,7 +20,6 @@ import org.wildfly.extras.creaper.core.online.operations.OperationException; import org.wildfly.extras.creaper.core.online.operations.Operations; import org.wildfly.extras.creaper.core.online.operations.admin.Administration; -import org.junit.Ignore; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -59,6 +62,15 @@ public class RemoveLoginModuleOnlineTest { .addModuleOption("realm", "ApplicationRealm") .build(); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException, CommandFailedException, OperationException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModuleOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModuleOnlineTest.java index bc68e9e3..42385037 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModuleOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModuleOnlineTest.java @@ -4,11 +4,15 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -16,7 +20,6 @@ import org.wildfly.extras.creaper.core.online.operations.OperationException; import org.wildfly.extras.creaper.core.online.operations.Operations; import org.wildfly.extras.creaper.core.online.operations.admin.Administration; -import org.junit.Ignore; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -59,6 +62,15 @@ public class RemoveMappingModuleOnlineTest { .addModuleOption("realm", "ApplicationRealm") .build(); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException, CommandFailedException, OperationException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomainOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomainOnlineTest.java index 59b2c92e..82e77fb4 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomainOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomainOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -32,6 +35,15 @@ public class RemoveSecurityDomainOnlineTest { private static final Address TEST_SECURITY_DOMAIN_ADDRESS = Address.subsystem("security").and("security-domain", TEST_SECURITY_DOMAIN_NAME); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthenticationOnlineTest.java index d33c606a..8ad92874 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthenticationOnlineTest.java @@ -4,7 +4,9 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; @@ -37,6 +39,15 @@ public class AddJaasAuthenticationOnlineTest { private static final Address TEST_SECURITY_REALM_JAAS_AUTHN_ADDRESS = TEST_SECURITY_REALM_ADDRESS.and("authentication", "jaas"); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthenticationOnlineTest.java index ed14e985..514891e8 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthenticationOnlineTest.java @@ -58,6 +58,8 @@ public static void checkServerVersionIsSupported() throws IOException { Assume.assumeTrue("Kerberos authentication in security realm is available since WildFly 9 or in EAP 6.4.x.", serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_1_7_0) && !serverVersion.inRange(ServerVersion.VERSION_2_0_0, ServerVersion.VERSION_2_2_0)); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); } @Before diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthenticationOnlineTest.java index fd55c2b7..bf8a308a 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthenticationOnlineTest.java @@ -4,7 +4,9 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; @@ -40,6 +42,15 @@ public class AddLdapAuthenticationOnlineTest { private static final Address TEST_LDAP_CONNECTION_ADDRESS = Address.coreService("management").and("ldap-connection", TEST_LDAP_CONNECTION); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorizationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorizationOnlineTest.java index af9df806..1041dbc8 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorizationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorizationOnlineTest.java @@ -4,7 +4,9 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.ManagementClient; @@ -17,7 +19,6 @@ import org.wildfly.extras.creaper.core.online.operations.Operations; import org.wildfly.extras.creaper.core.online.operations.admin.Administration; import org.wildfly.extras.creaper.core.CommandFailedException; -import org.junit.Assume; import org.wildfly.extras.creaper.core.ServerVersion; import static org.junit.Assert.assertEquals; @@ -51,6 +52,15 @@ public class AddLdapAuthorizationOnlineTest { private static final Address TEST_LDAP_CONNECTION_ADDRESS = Address.coreService("management").and("ldap-connection", TEST_LDAP_CONNECTION); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnectionOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnectionOnlineTest.java index 4df250e1..93b8e1d0 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnectionOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnectionOnlineTest.java @@ -7,11 +7,14 @@ import org.jboss.arquillian.junit.Arquillian; import org.jboss.dmr.ModelNode; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -37,6 +40,15 @@ public class AddLdapConnectionOnlineTest { private static final Address TEST_LDAP_CONNECTION_ADDRESS = Address.coreService("management").and("ldap-connection", TEST_LDAP_CONNECTION); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthenticationOnlineTest.java index 20f1453d..aaf0f221 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthenticationOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -36,6 +39,15 @@ public class AddLocalAuthenticationOnlineTest { private static final Address TEST_SECURITY_REALM_LOCAL_AUTHN_ADDRESS = TEST_SECURITY_REALM_ADDRESS.and("authentication", "local"); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthenticationOnlineTest.java index e482c4de..2a015f37 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthenticationOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -36,6 +39,15 @@ public class AddPropertiesAuthenticationOnlineTest { private static final Address TEST_SECURITY_REALM_PROPERTIES_AUTHN_ADDRESS = TEST_SECURITY_REALM_ADDRESS.and("authentication", "properties"); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorizationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorizationOnlineTest.java index 4a0cf0a0..8e85cdce 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorizationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorizationOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -36,6 +39,15 @@ public class AddPropertiesAuthorizationOnlineTest { private static final Address TEST_SECURITY_REALM_PROPERTIES_AUTHZ_ADDRESS = TEST_SECURITY_REALM_ADDRESS.and("authorization", "properties"); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthenticationOnlineTest.java index 153e80a3..15897952 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthenticationOnlineTest.java @@ -3,11 +3,14 @@ import com.google.common.io.BaseEncoding; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -38,6 +41,15 @@ public class AddSecretAuthenticationOnlineTest { private Operations ops; private Administration administration; + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealmOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealmOnlineTest.java index 1b2b8d5f..4f8bc5a6 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealmOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealmOnlineTest.java @@ -5,11 +5,14 @@ import org.jboss.arquillian.junit.Arquillian; import org.junit.After; import org.junit.Assert; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -34,6 +37,15 @@ public class AddSecurityRealmOnlineTest { private static final Address TEST_SECURITY_REALM_ADDRESS = Address.coreService("management").and("security-realm", TEST_SECURITY_REALM_NAME); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentityOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentityOnlineTest.java index 9cba503b..aab00e6d 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentityOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentityOnlineTest.java @@ -2,7 +2,9 @@ import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; @@ -39,6 +41,15 @@ public class AddSslServerIdentityOnlineTest { private static final String KEYSTORE_AND_KEY_PASSWORD = "password"; + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthenticationOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthenticationOnlineTest.java index 9602a5d3..dfc37988 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthenticationOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthenticationOnlineTest.java @@ -2,11 +2,14 @@ import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.ModelNodeResult; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; @@ -38,6 +41,15 @@ public class AddTruststoreAuthenticationOnlineTest { private Operations ops; private Administration administration; + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws Exception { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnectionOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnectionOnlineTest.java index b7252dee..782a2390 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnectionOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnectionOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -32,6 +35,15 @@ public class RemoveLdapConnectionOnlineTest { private static final Address TEST_LDAP_CONNECTION_ADDRESS = Address.coreService("management").and("ldap-connection", TEST_LDAP_CONNECTION_NAME); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealmOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealmOnlineTest.java index 4ae83fa6..a86dffea 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealmOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealmOnlineTest.java @@ -4,11 +4,14 @@ import java.util.concurrent.TimeoutException; import org.jboss.arquillian.junit.Arquillian; import org.junit.After; +import org.junit.Assume; import org.junit.Before; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.wildfly.extras.creaper.core.CommandFailedException; import org.wildfly.extras.creaper.core.ManagementClient; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.online.CliException; import org.wildfly.extras.creaper.core.online.OnlineManagementClient; import org.wildfly.extras.creaper.core.online.OnlineOptions; @@ -32,6 +35,15 @@ public class RemoveSecurityRealmOnlineTest { private static final Address TEST_SECURITY_REALM_ADDRESS = Address.coreService("management").and("security-realm", TEST_SECURITY_REALM_NAME); + @BeforeClass + public static void checkServerVersionIsSupported() throws Exception { + // check version is supported + ServerVersion serverVersion + = ManagementClient.online(OnlineOptions.standalone().localDefault().build()).version(); + Assume.assumeFalse("Legacy security was removed in WildFly 15.", + serverVersion.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); + } + @Before public void connect() throws IOException { client = ManagementClient.online(OnlineOptions.standalone().localDefault().build()); diff --git a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/undertow/AddUndertowListenerOnlineTest.java b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/undertow/AddUndertowListenerOnlineTest.java index ef919a8a..b2ee9011 100644 --- a/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/undertow/AddUndertowListenerOnlineTest.java +++ b/testsuite/standalone/src/test/java/org/wildfly/extras/creaper/commands/undertow/AddUndertowListenerOnlineTest.java @@ -83,6 +83,8 @@ public void addHttpConnector_commandSucceeds() throws Exception { @Test public void addHttpsConnector_commandSucceeds() throws Exception { + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + client.version().greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); String alias = "creaper"; File keystoreFile = tmp.newFile(); KeyStore keyStore = KeyPairAndCertificate.generateSelfSigned("Creaper").toKeyStore(alias, TEST_PASSWORD); @@ -156,6 +158,8 @@ public void addHttpsConnectorElytron_commandSucceeds() throws Exception { @Test public void addSecurityRealm_withoutTruststore_commandSucceeds() throws Exception { + Assume.assumeFalse("Legacy security was removed in WildFly 25.", + client.version().greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)); String alias = "creaper"; File keystoreFile = tmp.newFile(); KeyStore keyStore = KeyPairAndCertificate.generateSelfSigned("Creaper").toKeyStore(alias, TEST_PASSWORD); From 5b85f0ce59c10c2804e8f9f8be8030b298316130 Mon Sep 17 00:00:00 2001 From: Martin Simka Date: Thu, 5 Jan 2023 14:40:11 +0100 Subject: [PATCH 4/4] raise error when commands that require legacy security are used with WildFly 25 and above legacy security was removed in WildFly 25 --- .../commands/security/AddAuthorizationModule.java | 9 +++++++++ .../extras/creaper/commands/security/AddLoginModule.java | 9 +++++++++ .../creaper/commands/security/AddMappingModule.java | 9 +++++++++ .../creaper/commands/security/AddSecurityDomain.java | 9 +++++++++ .../commands/security/RemoveAuthorizationModule.java | 9 +++++++++ .../creaper/commands/security/RemoveLoginModule.java | 9 +++++++++ .../creaper/commands/security/RemoveMappingModule.java | 9 +++++++++ .../creaper/commands/security/RemoveSecurityDomain.java | 9 +++++++++ .../commands/security/realms/AddJaasAuthentication.java | 6 ++++++ .../security/realms/AddKerberosAuthentication.java | 7 +++++++ .../commands/security/realms/AddLdapAuthentication.java | 8 ++++++++ .../commands/security/realms/AddLdapAuthorization.java | 8 ++++++++ .../commands/security/realms/AddLdapConnection.java | 9 +++++++++ .../commands/security/realms/AddLocalAuthentication.java | 9 +++++++++ .../security/realms/AddPropertiesAuthentication.java | 9 +++++++++ .../security/realms/AddPropertiesAuthorization.java | 9 +++++++++ .../security/realms/AddSecretAuthentication.java | 9 +++++++++ .../commands/security/realms/AddSecurityRealm.java | 9 +++++++++ .../commands/security/realms/AddSslServerIdentity.java | 8 ++++++++ .../security/realms/AddTruststoreAuthentication.java | 9 +++++++++ .../commands/security/realms/RemoveLdapConnection.java | 9 +++++++++ .../commands/security/realms/RemoveSecurityRealm.java | 9 +++++++++ 22 files changed, 190 insertions(+) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModule.java index fb2679e7..da2771b6 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddAuthorizationModule.java @@ -7,6 +7,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.CliException; @@ -43,6 +44,10 @@ private AddAuthorizationModule(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address authorizationClassicAddress = Address.subsystem("security") .and("security-domain", securityDomainName) @@ -78,6 +83,10 @@ public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedEx @Override public void apply(OfflineCommandContext ctx) throws CommandFailedException, IOException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddAuthorizationModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddLoginModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddLoginModule.java index 489d52ad..69826ac6 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddLoginModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddLoginModule.java @@ -7,6 +7,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.CliException; @@ -46,6 +47,10 @@ protected AddLoginModule(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address authenticationClassicAddress = Address.subsystem("security") .and("security-domain", securityDomainName) @@ -81,6 +86,10 @@ public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedEx @Override public void apply(OfflineCommandContext ctx) throws CommandFailedException, IOException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddLoginModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddMappingModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddMappingModule.java index b8246e50..dcd23940 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddMappingModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddMappingModule.java @@ -7,6 +7,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.CliException; @@ -43,6 +44,10 @@ private AddMappingModule(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address mappingClassicAddress = Address.subsystem("security") .and("security-domain", securityDomainName) @@ -78,6 +83,10 @@ public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedEx @Override public void apply(OfflineCommandContext ctx) throws CommandFailedException, IOException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddMappingModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomain.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomain.java index ef1831ec..08dfdaf7 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomain.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/AddSecurityDomain.java @@ -5,6 +5,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.CliException; @@ -34,6 +35,10 @@ private AddSecurityDomain(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address securityDomainAddress = Address.subsystem("security").and("security-domain", securityDomainName); if (replaceExisting) { @@ -50,6 +55,10 @@ public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedEx @Override public void apply(OfflineCommandContext ctx) throws CommandFailedException, IOException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddSecurityDomain.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModule.java index 6108bb75..bd4b5d81 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveAuthorizationModule.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -36,6 +37,10 @@ public RemoveAuthorizationModule(String securityDomainName, String authorization @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.subsystem("security") .and("security-domain", securityDomainName) @@ -45,6 +50,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveAuthorizationModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModule.java index 8a83bc6c..37097723 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveLoginModule.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -36,6 +37,10 @@ public RemoveLoginModule(String securityDomainName, String loginModuleName) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.subsystem("security") .and("security-domain", securityDomainName) @@ -45,6 +50,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveLoginModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModule.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModule.java index fdf575e5..6af8dc2a 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModule.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveMappingModule.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -36,6 +37,10 @@ public RemoveMappingModule(String securityDomainName, String mappingModuleName) @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.subsystem("security") .and("security-domain", securityDomainName) @@ -45,6 +50,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveMappingModule.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomain.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomain.java index be74bacb..0c5a9084 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomain.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/RemoveSecurityDomain.java @@ -5,6 +5,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; import org.wildfly.extras.creaper.core.CommandFailedException; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.CliException; @@ -33,12 +34,20 @@ public RemoveSecurityDomain(String securityDomainName) { @Override public void apply(OnlineCommandContext ctx) throws CliException, CommandFailedException, IOException, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.subsystem("security").and("security-domain", securityDomainName)); } @Override public void apply(OfflineCommandContext ctx) throws CommandFailedException, IOException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveSecurityDomain.class) .subtree("securitySubsystem", Subtree.subsystem("security")) .parameter("atrSecurityDomainName", securityDomainName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthentication.java index e9a401ba..c47ddf64 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddJaasAuthentication.java @@ -26,6 +26,9 @@ private AddJaasAuthentication(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } if (assignGroups != null) { if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) || ctx.version.inRange(ServerVersion.VERSION_2_0_0, ServerVersion.VERSION_2_2_0)) { @@ -46,6 +49,9 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } if (assignGroups != null) { if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) || ctx.version.inRange(ServerVersion.VERSION_2_0_0, ServerVersion.VERSION_2_2_0)) { diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthentication.java index 2211a8d3..e44e6e40 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddKerberosAuthentication.java @@ -31,6 +31,9 @@ private AddKerberosAuthentication(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) || ctx.version.inRange(ServerVersion.VERSION_2_0_0, ServerVersion.VERSION_2_2_0)) { throw new AssertionError("Kerberos authentication in security realm is available since WildFly 9 or in EAP 6.4.x."); @@ -77,6 +80,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) || ctx.version.inRange(ServerVersion.VERSION_2_0_0, ServerVersion.VERSION_2_2_0)) { throw new AssertionError("Kerberos authentication in security realm is available since WildFly 9 or in EAP 6.4.x."); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthentication.java index 000294d6..271b0f58 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthentication.java @@ -40,6 +40,10 @@ private AddLdapAuthentication(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + if (usernameLoad != null) { ctx.version.assertAtLeast(ServerVersion.VERSION_2_0_0, "Option username-load is available since WildFly 8"); @@ -78,6 +82,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + if (usernameLoad != null) { ctx.version.assertAtLeast(ServerVersion.VERSION_2_0_0, "Option username-load is available since WildFly 8"); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorization.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorization.java index f2833f88..c6d4f8fd 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorization.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapAuthorization.java @@ -35,6 +35,10 @@ private AddLdapAuthorization(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + if (groupToPrincipal != null) { if (groupToPrincipal.preferOriginalConnection != null) { if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) @@ -146,6 +150,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + if (groupToPrincipal != null) { if (groupToPrincipal.preferOriginalConnection != null) { if (ctx.version.lessThan(ServerVersion.VERSION_1_7_0) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnection.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnection.java index d199bece..1b92acb2 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnection.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLdapConnection.java @@ -7,6 +7,7 @@ import java.util.Map; import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -49,6 +50,10 @@ private AddLdapConnection(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address ldapConnection = Address.coreService("management").and("ldap-connection", connectionName); if (replaceExisting) { @@ -89,6 +94,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddLdapConnection.class) .subtree("management", Subtree.management()) .parameter("atrConnectionName", connectionName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthentication.java index 97189e73..3a779804 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddLocalAuthentication.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -27,6 +28,10 @@ private AddLocalAuthentication(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address securityRealmJaasAuthnAddress = securityRealmAddress.and("authentication", "local"); if (replaceExisting) { @@ -41,6 +46,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddLocalAuthentication.class) .subtree("management", Subtree.management()) .parameter("atrSecurityRealmName", securityRealmName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthentication.java index 12810a2b..f3feb8fd 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthentication.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -27,6 +28,10 @@ private AddPropertiesAuthentication(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address securityRealmPropertiesAuthnAddress = securityRealmAddress.and("authentication", "properties"); if (replaceExisting) { @@ -41,6 +46,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddPropertiesAuthentication.class) .subtree("management", Subtree.management()) .parameter("atrSecurityRealmName", securityRealmName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorization.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorization.java index af913ad7..d98f7964 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorization.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddPropertiesAuthorization.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -25,6 +26,10 @@ private AddPropertiesAuthorization(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address securityRealmPropertiesAuthzAddress = securityRealmAddress.and("authorization", "properties"); if (replaceExisting) { @@ -38,6 +43,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddPropertiesAuthorization.class) .subtree("management", Subtree.management()) .parameter("atrSecurityRealmName", securityRealmName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthentication.java index c5cce6b1..569a7898 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecretAuthentication.java @@ -3,6 +3,7 @@ import com.google.common.io.BaseEncoding; import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -22,6 +23,10 @@ protected AddSecretAuthentication(Builder builder) { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddSecretAuthentication.class) .subtree("management", Subtree.management()) .parameter("realmName", securityRealmName) @@ -32,6 +37,10 @@ public void apply(OfflineCommandContext ctx) throws Exception { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Address secretServerIdentitiesAddress = securityRealmAddress.and("server-identity", "secret"); Operations ops = new Operations(ctx.client); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealm.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealm.java index 06ba4ce4..a98958e6 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealm.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSecurityRealm.java @@ -3,6 +3,7 @@ import java.io.IOException; import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -30,6 +31,10 @@ private AddSecurityRealm(Builder builder) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); Address securityRealmAddress = Address.coreService("management").and("security-realm", securityRealmName); if (replaceExisting) { @@ -46,6 +51,10 @@ public void apply(OnlineCommandContext ctx) throws Exception { @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddSecurityRealm.class) .subtree("management", Subtree.management()) .parameter("atrSecurityRealmName", securityRealmName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentity.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentity.java index de49a10b..d6b496d3 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentity.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddSslServerIdentity.java @@ -44,6 +44,10 @@ public AddSslServerIdentity(Builder builder) { @Override public final void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddSslServerIdentity.class) .subtree("management", Subtree.management()) .parameter("realmName", securityRealmName) @@ -65,6 +69,10 @@ public final void apply(OfflineCommandContext ctx) throws Exception { @Override public final void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Address sslServerIdentitiesAddress = securityRealmAddress.and("server-identity", "ssl"); Operations ops = new Operations(ctx.client); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthentication.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthentication.java index 73ba58bc..94766d72 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthentication.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/AddTruststoreAuthentication.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommandContext; import org.wildfly.extras.creaper.core.online.operations.Address; @@ -25,6 +26,10 @@ public AddTruststoreAuthentication(Builder builder) { @Override public final void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(AddTruststoreAuthentication.class) .subtree("management", Subtree.management()) .parameter("realmName", securityRealmName) @@ -38,6 +43,10 @@ public final void apply(OfflineCommandContext ctx) throws Exception { @Override public final void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Address truststoreAuthAddress = securityRealmAddress.and("authentication", "truststore"); Operations ops = new Operations(ctx.client); diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnection.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnection.java index 57e7bc1c..5925ba28 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnection.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveLdapConnection.java @@ -2,6 +2,7 @@ import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -30,12 +31,20 @@ public RemoveLdapConnection(String connectionName) { @Override public void apply(OnlineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.coreService("management").and("ldap-connection", connectionName)); } @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveLdapConnection.class) .subtree("management", Subtree.management()) .parameter("atrLdapConnectionName", connectionName) diff --git a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealm.java b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealm.java index 6bf9a7db..28c67845 100644 --- a/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealm.java +++ b/commands/src/main/java/org/wildfly/extras/creaper/commands/security/realms/RemoveSecurityRealm.java @@ -3,6 +3,7 @@ import java.util.concurrent.TimeoutException; import org.wildfly.extras.creaper.commands.foundation.offline.xml.GroovyXmlTransform; import org.wildfly.extras.creaper.commands.foundation.offline.xml.Subtree; +import org.wildfly.extras.creaper.core.ServerVersion; import org.wildfly.extras.creaper.core.offline.OfflineCommand; import org.wildfly.extras.creaper.core.offline.OfflineCommandContext; import org.wildfly.extras.creaper.core.online.OnlineCommand; @@ -32,12 +33,20 @@ public RemoveSecurityRealm(String securityRealmName) { @Override public void apply(OnlineCommandContext ctx) throws Exception, TimeoutException, InterruptedException { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + Operations ops = new Operations(ctx.client); ops.remove(Address.coreService("management").and("security-realm", securityRealmName)); } @Override public void apply(OfflineCommandContext ctx) throws Exception { + if (ctx.version.greaterThanOrEqualTo(ServerVersion.VERSION_18_0_0)) { + throw new AssertionError("Legacy security was removed in WildFly 25."); + } + ctx.client.apply(GroovyXmlTransform.of(RemoveSecurityRealm.class) .subtree("management", Subtree.management()) .parameter("atrSecurityRealmName", securityRealmName)