From 51f4f1f18b775198abed496541e1b4cc1036cb79 Mon Sep 17 00:00:00 2001 From: Darran Lofthouse Date: Fri, 20 Dec 2024 18:33:04 +0000 Subject: [PATCH] [WFCORE-7110] Deprecate the security manager subsystem and report it will be removed in a future release. --- .../extension/security/manager/SecurityManagerExtension.java | 3 ++- .../security/manager/SecurityManagerRootDefinition.java | 3 +++ .../extension/security/manager/LocalDescriptions.properties | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtension.java b/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtension.java index f5d74c897cb..f46f12294f7 100644 --- a/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtension.java +++ b/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerExtension.java @@ -27,7 +27,8 @@ public class SecurityManagerExtension implements Extension { public static final PathElement SUBSYSTEM_PATH = PathElement.pathElement(SUBSYSTEM, Constants.SUBSYSTEM_NAME); protected static final String RESOURCE_NAME = SecurityManagerExtension.class.getPackage().getName() + ".LocalDescriptions"; - private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(3, 0, 0); + private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(4); + static final ModelVersion DEPRECATED_SINCE = ModelVersion.create(4); public static StandardResourceDescriptionResolver getResolver(final String... keyPrefix) { StringBuilder prefix = new StringBuilder(Constants.SUBSYSTEM_NAME); diff --git a/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerRootDefinition.java b/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerRootDefinition.java index adb1aecbe87..7412d9df407 100644 --- a/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerRootDefinition.java +++ b/security-manager/src/main/java/org/wildfly/extension/security/manager/SecurityManagerRootDefinition.java @@ -5,6 +5,8 @@ package org.wildfly.extension.security.manager; +import static org.wildfly.extension.security.manager.SecurityManagerExtension.DEPRECATED_SINCE; + import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -29,6 +31,7 @@ class SecurityManagerRootDefinition extends PersistentResourceDefinition { private SecurityManagerRootDefinition() { super (SecurityManagerExtension.SUBSYSTEM_PATH, SecurityManagerExtension.getResolver(), SecurityManagerSubsystemAdd.INSTANCE, ReloadRequiredRemoveStepHandler.INSTANCE); + setDeprecated(DEPRECATED_SINCE); } @Override diff --git a/security-manager/src/main/resources/org/wildfly/extension/security/manager/LocalDescriptions.properties b/security-manager/src/main/resources/org/wildfly/extension/security/manager/LocalDescriptions.properties index ab909fe6b00..5b8b6a8729e 100644 --- a/security-manager/src/main/resources/org/wildfly/extension/security/manager/LocalDescriptions.properties +++ b/security-manager/src/main/resources/org/wildfly/extension/security/manager/LocalDescriptions.properties @@ -4,6 +4,7 @@ # security-manager=The Security Manager subsystem +security-manager.deprecated=The use of the Java security manager is being disabled in Java under JEP-486, additionally security manager integration is not supported with Jakarta EE 11. The security manager extension will be removed in a future version. security-manager.add=Operation Adds subsystem security-manager.remove=Operation Removes subsystem security-manager.deployment-permissions=The permissions that are to be granted to deployments