Search in sources :

Example 1 with ProxyWhitelist

use of org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist in project workflow-cps-plugin by jenkinsci.

the class CpsWhitelist method get.

static synchronized Whitelist get() {
    Jenkins j = Jenkins.getInstanceOrNull();
    if (j == null) {
        LOGGER.warning("Jenkins is not running");
        return new ProxyWhitelist();
    }
    Whitelist wrapped = wrappedByJenkins.get(j);
    if (wrapped == null) {
        wrapped = new ProxyWhitelist(new CpsWhitelist(), Whitelist.all());
        try {
            if (!wrapped.permitsStaticMethod(Safepoint.class.getMethod("safepoint"), new Object[0])) {
                throw new IllegalStateException("Broken whitelists: " + wrapped);
            }
        } catch (NoSuchMethodException x) {
            assert false : x;
        }
        wrappedByJenkins.put(j, wrapped);
    }
    return wrapped;
}
Also used : Jenkins(jenkins.model.Jenkins) AbstractWhitelist(org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.AbstractWhitelist) ProxyWhitelist(org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist) Whitelist(org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist) ProxyWhitelist(org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist)

Aggregations

Jenkins (jenkins.model.Jenkins)1 Whitelist (org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist)1 AbstractWhitelist (org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.AbstractWhitelist)1 ProxyWhitelist (org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist)1