Reputation: 35864
Yes, we're aware of all the security risks that come with the ability to upload code into a production system by users, but for the sake of this question let's pretend it doesn't matter.
In a Grails application being developed we need to allow the user to upload some Groovy code that will be used by the Grails application as well as a CLI that our customers will download and use.
I am aware of the following documentation regarding embedding Groovy.
Is there a better alternative than embedding and interpreting on the fly? Or is this pretty much it?
Upvotes: 0
Views: 254
Reputation: 3532
Depends on what you mean by embedding Groovy. The console plugin provides a fairly nice way of adding running code on the fly with access to the grails context and domain classes. http://grails.org/plugin/console . If you look into the code, it wouldn't be very hard to simply store scripts in your database as strings and use the script execution mechanism provided by the plugin.
Upvotes: 1