Skip to content

Remove Java Security Manager#4541

Open
madurangasiriwardena wants to merge 1 commit intowso2:4.12.xfrom
madurangasiriwardena:remove-sec-manager
Open

Remove Java Security Manager#4541
madurangasiriwardena wants to merge 1 commit intowso2:4.12.xfrom
madurangasiriwardena:remove-sec-manager

Conversation

@madurangasiriwardena
Copy link
Member

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 093fe099-a4ec-4f02-bd28-48730288d0f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +1529 to +1530
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
return method.invoke(instance, objects);
}
});
} catch (PrivilegedActionException e) {
if (e.getCause() != null && e.getCause().getCause() != null && e.getCause().getCause() instanceof
UserStoreException) {
// Actual UserStoreException get wrapped with two exceptions
throw new UserStoreException(e.getCause().getCause().getMessage(), e);

return method.invoke(instance, objects);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 1

Suggested change
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
return method.invoke(instance, objects);
}
});
} catch (PrivilegedActionException e) {
if (e.getCause() != null && e.getCause().getCause() != null && e.getCause().getCause() instanceof
UserStoreException) {
// Actual UserStoreException get wrapped with two exceptions
throw new UserStoreException(e.getCause().getCause().getMessage(), e);
return method.invoke(instance, objects);
try {
if (log.isDebugEnabled()) {
log.debug("Invoking method: " + methodName + " via reflection");
}
return method.invoke(instance, objects);
Comment on lines 1534 to 1537
throw new UserStoreException(e.getCause().getMessage(), e);
} else {
String msg = "Error occurred while accessing Java Security Manager Privilege Block";
String msg = "Error occurred while invoking method via reflection";
log.error(msg);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 2

Suggested change
throw new UserStoreException(e.getCause().getMessage(), e);
} else {
String msg = "Error occurred while accessing Java Security Manager Privilege Block";
String msg = "Error occurred while invoking method via reflection";
log.error(msg);
throw new UserStoreException(e.getCause().getMessage(), e);
} else {
String msg = "Error occurred while invoking method via reflection";
log.error(msg + ": " + e.getMessage());
Comment on lines +1554 to +1555
boolean domainProvided = index > 0;
return authenticate(userName, credential, domainProvided);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 3

Suggested change
boolean domainProvided = index > 0;
return authenticate(userName, credential, domainProvided);
boolean domainProvided = index > 0;
return authenticate(userName, credential, domainProvided);
log.info("User authentication attempt for user: " + userName);
boolean result = authenticate(userName, credential, domainProvided);
if (result) {
log.info("User authentication successful for user: " + userName);
} else {
log.warn("User authentication failed for user: " + userName);
}
return result;
Comment on lines 4181 to 4182
public final void deleteUser(String userName) throws UserStoreException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 4

Suggested change
public final void deleteUser(String userName) throws UserStoreException {
public final void deleteUser(String userName) throws UserStoreException {
log.info("Attempting to delete user: " + userName);
Comment on lines +146 to +149
public org.wso2.carbon.user.api.UserRealm getTenantUserRealm(int tenantId)
throws org.wso2.carbon.user.api.UserStoreException {

try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<org.wso2.carbon.user.api.UserRealm>() {
@Override
public org.wso2.carbon.user.api.UserRealm run() throws Exception {
return getTenantUserRealmInternal(tenantId);
}
});
} catch (PrivilegedActionException e) {
throw (org.wso2.carbon.user.api.UserStoreException) e.getException();
}
return getTenantUserRealmInternal(tenantId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 5

Suggested change
public org.wso2.carbon.user.api.UserRealm getTenantUserRealm(int tenantId)
throws org.wso2.carbon.user.api.UserStoreException {
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<org.wso2.carbon.user.api.UserRealm>() {
@Override
public org.wso2.carbon.user.api.UserRealm run() throws Exception {
return getTenantUserRealmInternal(tenantId);
}
});
} catch (PrivilegedActionException e) {
throw (org.wso2.carbon.user.api.UserStoreException) e.getException();
}
return getTenantUserRealmInternal(tenantId);
public org.wso2.carbon.user.api.UserRealm getTenantUserRealm(int tenantId)
throws org.wso2.carbon.user.api.UserStoreException {
if (log.isDebugEnabled()) {
log.debug("Getting user realm for tenant: " + tenantId);
}
return getTenantUserRealmInternal(tenantId);
Comment on lines +206 to +208
public UserRealm getUserRealm(RealmConfiguration tenantRealmConfig) throws UserStoreException {

try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<UserRealm>() {
@Override
public UserRealm run() throws Exception {
return getUserRealmInternal(tenantRealmConfig);
}
});
} catch (PrivilegedActionException e) {
throw (UserStoreException) e.getException();
}
return getUserRealmInternal(tenantRealmConfig);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 6

Suggested change
public UserRealm getUserRealm(RealmConfiguration tenantRealmConfig) throws UserStoreException {
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<UserRealm>() {
@Override
public UserRealm run() throws Exception {
return getUserRealmInternal(tenantRealmConfig);
}
});
} catch (PrivilegedActionException e) {
throw (UserStoreException) e.getException();
}
return getUserRealmInternal(tenantRealmConfig);
public UserRealm getUserRealm(RealmConfiguration tenantRealmConfig) throws UserStoreException {
if (log.isDebugEnabled()) {
log.debug("Getting user realm for tenant configuration");
}
return getUserRealmInternal(tenantRealmConfig);
Comment on lines 59 to 61
System.setProperty("javax.net.ssl.trustStoreType", type);
System.setProperty("javax.net.ssl.trustStorePassword", password);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 7

Suggested change
System.setProperty("javax.net.ssl.trustStoreType", type);
System.setProperty("javax.net.ssl.trustStorePassword", password);
System.setProperty("javax.net.ssl.trustStorePassword", password);
log.info("SSL trust store configurations loaded successfully");
Comment on lines 61 to 63

if (secMan != null) {
secMan.checkPermission(new ManagementPermission("control"));
}
try {
if (Boolean.parseBoolean(System.getProperty("NonUserCoreMode"))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log Improvement Suggestion No: 8

Suggested change
if (secMan != null) {
secMan.checkPermission(new ManagementPermission("control"));
}
try {
if (Boolean.parseBoolean(System.getProperty("NonUserCoreMode"))) {
try {
if (Boolean.parseBoolean(System.getProperty("NonUserCoreMode"))) {
log.info("Starting UserCore component in NonUserCoreMode");
Copy link

@wso2-engineering wso2-engineering bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1
#### Log Improvement Suggestion No: 2
#### Log Improvement Suggestion No: 3
#### Log Improvement Suggestion No: 4
#### Log Improvement Suggestion No: 5
#### Log Improvement Suggestion No: 6
#### Log Improvement Suggestion No: 7
#### Log Improvement Suggestion No: 8
@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/22996178077
Status: cancelled

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/22998420664
Status: failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants