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

[APIM] Add Support to Config Java Access Control through JS in Script Mediator #2133

Merged

Conversation

Avishka-Shamendra
Copy link
Contributor

@Avishka-Shamendra Avishka-Shamendra commented Jan 26, 2024

Purpose

The access to java classes though JS in script mediator can be controlled through following synapse propeties

limit_java_class_access_in_scripts.enable= true
limit_java_class_access_in_scripts.list_type = BLOCK_LIST # or ALLOW_LIST
limit_java_class_access_in_scripts.class_prefixes = java.util # Prefixes of class names, to be allowed or blocked
limit_java_native_object_access_in_scripts.enable = true
limit_java_native_object_access_in_scripts.list_type = BLOCK_LIST # or ALLOW_LIST
limit_java_native_object_access_in_scripts.object_names = getClassLoader,loadClass # Native method names, to be allowed or blocked

@Avishka-Shamendra
Copy link
Contributor Author

The MI build appears to be unstable in previously merged PRs as well. However, since wso2-synapse was successfully built locally with all tests passing, we can proceed with the merge.

@senthuran16 senthuran16 merged commit 83e48ba into wso2:master Jan 26, 2024
1 of 2 checks passed
* @return Whether the access is allowed or not.
*/
public static boolean isAccessAllowed(String string, AccessControlConfig accessControlConfig,
Comparator<String> comparator) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please look into the indentations in here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indentation seems to be ok on IntelliJ

limit_java_class_access_in_scripts.class_prefixes = java.util.ArrayList
limit_java_native_object_access_in_scripts.enable = true
limit_java_native_object_access_in_scripts.list_type = BLOCK_LIST
limit_java_native_object_access_in_scripts.object_names = getClassLoader,loadClass
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a new line here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed through PR #2159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants