Class ClassLoaderWhitelist

java.lang.Object
org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.ClassLoaderWhitelist

public final class ClassLoaderWhitelist extends Whitelist
Whitelist that allows everything defined from a specific classloader.
Author:
Jesse Glick
  • Constructor Details

    • ClassLoaderWhitelist

      public ClassLoaderWhitelist(ClassLoader scriptLoader)
  • Method Details

    • permitsMethod

      public boolean permitsMethod(Method method, Object receiver, Object[] args)
      Description copied from class: Whitelist
      Checks whether a given virtual method may be invoked.

      Note that method should not be implementing or overriding a method in a supertype; in such a case the caller must pass that supertype method instead. In other words, call site selection is the responsibility of the caller (such as StandardGroovySandbox), not the whitelist.

      Specified by:
      permitsMethod in class Whitelist
      Parameters:
      method - a method defined in the JVM
      receiver - this, the receiver of the method call
      args - zero or more arguments
      Returns:
      true to allow the method to be called, false to reject it
    • permitsConstructor

      public boolean permitsConstructor(Constructor<?> constructor, Object[] args)
      Specified by:
      permitsConstructor in class Whitelist
    • permitsStaticMethod

      public boolean permitsStaticMethod(Method method, Object[] args)
      Specified by:
      permitsStaticMethod in class Whitelist
    • permitsFieldGet

      public boolean permitsFieldGet(Field field, Object receiver)
      Specified by:
      permitsFieldGet in class Whitelist
    • permitsFieldSet

      public boolean permitsFieldSet(Field field, Object receiver, Object value)
      Specified by:
      permitsFieldSet in class Whitelist
    • permitsStaticFieldGet

      public boolean permitsStaticFieldGet(Field field)
      Specified by:
      permitsStaticFieldGet in class Whitelist
    • permitsStaticFieldSet

      public boolean permitsStaticFieldSet(Field field, Object value)
      Specified by:
      permitsStaticFieldSet in class Whitelist