We are using GraalVM for some scripting requirements in our product. The version of the GraalVM is 21.2.0 We are using JavaScript and Groovy. We want to forbid some methods on certain classes from using in scripts. Example :
mytest.js
var testService=Java.type('mypackage.TestService');
new testService().forbiddenJavaMethod(); // this should not be called
TestService.java
package mypackage;
public class TestService{
public void forbiddenJavaMethod(){
// business logic
}
}
Is there a way to achieve this in Graal ? I could not find a way to do "method" filtering. Any other approach to solve this?