-
Notifications
You must be signed in to change notification settings - Fork 864
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
Using annotations to control accessibility of java object in rhino #1792
Comments
Hello @821938089 is the intention, that you want to execute code from (untrusted) user inputs and you want to try to add security with these annotations? |
Not for the sake of security, I'm using Rhino on Android and the app is written in Kotlin. |
Thanks for providing a use case. I took a look at the existing code. Every java object is wrapped by WrapperFactory in a NativeJavaObject I see the following possibilities you can do now:
Of course, it would be possible to add some checks for Maybe, it would also be also possible to enforce the static type here - so if you have |
Add three new annotations (tentative names):
@RhinoRestricted
@RhinoPublic
@RhinoPrivate
Usage:
Methods and fields and constructors marked with the RhinoPrivate annotation are not accessible in Rhino.
All methods and fields and constructors of a class marked with the RhinoRestricted annotation cannot be accessed within Rhino unless marked RhinoPublic.
The text was updated successfully, but these errors were encountered: