-
Improvement
-
Resolution: Won't Fix
-
Minor
-
None
I would like to get the following signatures whitelisted so that some dynamic nature can be added to the pipeline shared library classes:
- new groovy.lang.Binding
- method groovy.lang.Binding getVariable java.lang.String
- method groovy.lang.Binding getVariables
- method groovy.lang.Binding removeVariable java.lang.String
- method groovy.lang.Binding setVariable java.lang.String java.lang.Object
- method groovy.lang.Script setBinding groovy.lang.Binding
- method groovy.lang.GroovyObject getProperty java.lang.String
- method groovy.lang.GroovyObject invokeMethod java.lang.String java.lang.Object
I am assuming that signatures from 1 to 8 are safe from sandbox point of view. The Binding signatures (1 to 6) would allow a script to manipulate its own namespace, but it is not useful to break out of the sandbox. The signatures 7 and 8 would allow one to customize the Script/CpsScript implementations. Overriding these signature is already possible, but the overridden method is not allowed to delegate to the existing implementation (e.g., by calling super.getProperty()) and the above signatures are crucial to make these overrides actually useful and meaningful.
I am not sure if it is OK to include setProperty to this list, but I would include for completeness it if it also safe.