Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marks classes related to SecurityManager as deprecated #344

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/main/java/ognl/OgnlRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,19 @@ public class OgnlRuntime {
* Users that have their own Security Manager implementations and no intention to use the OGNL SecurityManager
* sandbox may choose to use the 'forceDisableOnInit' flag option for performance reasons (avoiding overhead
* involving the system property security checks - when that feature will not be used).
* @deprecated will removed in 3.5.x
*/
@Deprecated
static final String OGNL_SECURITY_MANAGER = "ognl.security.manager";
static final String OGNL_SM_FORCE_DISABLE_ON_INIT = "forceDisableOnInit";

/**
* Hold environment flag state associated with OGNL_SECURITY_MANAGER. See
* {@link OgnlRuntime#OGNL_SECURITY_MANAGER} for more details.
* Default: false (if not set).
* @deprecated will be removed in 3.5.x
*/
@Deprecated
private static final boolean _disableOgnlSecurityManagerOnInit;

static {
Expand Down Expand Up @@ -357,6 +361,10 @@ public class OgnlRuntime {
private static final PrimitiveTypes primitiveTypes = new PrimitiveTypes();
private static final PrimitiveDefaults primitiveDefaults = new PrimitiveDefaults();

/**
* @deprecated will be removed in 3.5.x
*/
@Deprecated
static SecurityManager securityManager = System.getSecurityManager();
static final EvaluationPool _evaluationPool = new EvaluationPool();

Expand Down Expand Up @@ -741,7 +749,9 @@ public static Class<?>[] getParameterTypes(Constructor<?> constructor) throws Ca
* Gets the SecurityManager that OGNL uses to determine permissions for invoking methods.
*
* @return SecurityManager for OGNL
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public static SecurityManager getSecurityManager() {
return securityManager;
}
Expand All @@ -750,7 +760,9 @@ public static SecurityManager getSecurityManager() {
* Sets the SecurityManager that OGNL uses to determine permissions for invoking methods.
*
* @param value SecurityManager to set
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public static void setSecurityManager(SecurityManager value) {
securityManager = value;
}
Expand Down Expand Up @@ -3012,7 +3024,9 @@ public static boolean getUseStricterInvocationValue() {
*
* @return true if OGNL SecurityManager was disabled on initialization, false otherwise.
* @since 3.1.25
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public static boolean getDisableOgnlSecurityManagerOnInitValue() {
return _disableOgnlSecurityManagerOnInit;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ognl/security/OgnlSecurityManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
* execution finished.</p>
*
* @since 3.1.24
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public class OgnlSecurityManager extends SecurityManager {

private static final String OGNL_SANDBOX_CLASS_NAME = "ognl.security.UserMethod";
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ognl/security/OgnlSecurityManagerFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
* Builds and provides a JVM wide singleton shared thread-safe with all permissions granted security manager for ognl
*
* @since 3.1.24
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public class OgnlSecurityManagerFactory extends SecureClassLoader {

private static volatile Object ognlSecurityManager;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ognl/security/UserMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
* A signature for {@link OgnlSecurityManager#isAccessDenied(java.security.Permission)}. Also executes user methods with not any permission.
*
* @since 3.1.24
* @deprecated will be removed in 3.5.x
*/
@Deprecated
public class UserMethod implements PrivilegedExceptionAction<Object> {

private final Object target;
Expand Down
Loading