Hi Jesse! Thanks for the comments. I didn't think about using an AtomicReference, much better this way :)
I had copied the doCheckScript method from your sample pull request, but I didn't find a way to pass the sandbox parameter without adding some Javascript code to get its value. wrt the sandbox and configuring() method, do you think maybe changing the signature to include the sandbox as parameter and simply returning the script if sanbbox==true would help? This way plugin devs wouldn't have to remember to check the sandbox value. Thanks again! Bruno >________________________________ > From: Jesse Glick <[email protected]> >To: [email protected] >Sent: Monday, March 31, 2014 11:44 AM >Subject: Re: Script Security plugin > > >On Fri, Mar 28, 2014 at 7:03 PM, Bruno P. Kinoshita ><[email protected]> wrote: >> https://github.com/Seitenbau/sb-jenkins-dynamicparameter/pull/28 > >I noted several mistakes in the usage of the various ScriptApproval >methods. I wonder if I need to make an easier-to-use wrapper object >for GroovyLanguage, basically a Describable containing a script and a >sandbox flag, which would have a stock config.jelly (including >help-sandbox.html and a doCheckScript method), and a constructor and >some other methods that calls the right things at the right times. The >downside is that this would not be serialization-compatible with >current describable classes which have a direct script field; they >would need to have a readResolve method that converts the inline >script into this wrapper. I will think about it though. > >> feel free to massage the text as needed > >I did. > >> I added a custom Runnable to store the result of the >> script execution, since the plug-in uses it to create the dynamic parameters >> (or was there an easier way?) > >An overload taking Callable could be added as a convenience. (You can >use an inline Runnable class and an AtomicReference for more concise >code using the current API, BTW.) > > >-- >You received this message because you are subscribed to the Google Groups >"Jenkins Developers" group. >To unsubscribe from this group and stop receiving emails from it, send an >email to [email protected]. >For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
