I am currently writing an application that takes a series of Clojure forms, and when they are evaluated, the results are listed
so for example the input would be
(data "abc" :identifier) (data "gee" :identifier) (content "def" :identifier [1 2 3 4 5])
The functions in the backend basically just turn them into Clojure cards, for example.
(defn data [text id] {:text text :id id}) (defn content [text id cont] {:text text :id id :cont cont})
The problem is that I am currently processing the code, accepting input from (-> input read-string eval) and getting the contents accordingly. This is bad because anyone can just add a tricky (System/exit 1) to enter and shut down the JVM
Is there a way to βwhitelistβ Clojure forms that can be completed in this step and blacklist all the nasty things? Or am I too naive to use Clojure forms as a data entry mechanism?
source share