How can I use the Clojure sandbox?

I am writing an application that allows users of my application to extend it using Clojure. Clojure is entered through the web page of the application and is "nullified" to run. My question is, how can I use this code introduced by users so that it doesn't harm anything or cause System.exit or something like that?

+7
source share
2 answers

You should be able to restrict access to the code by setting the JDK permissions level. Look at the settings of RuntimePermission, for example, direct configuration to prevent JVM from stopping (for example, System.exit ).

+3
source

There is a library for this. The lazybot in the Clojure IRC chanel uses it. You can find it here: https://github.com/flatland/clojail

+17
source

All Articles