Class Whitelist
java.lang.Object
org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist
- Direct Known Subclasses:
AbstractWhitelist
,AclAwareWhitelist
,BlanketWhitelist
,ClassLoaderWhitelist
,EnumeratingWhitelist
,GroovyWhitelist
,ProxyWhitelist
Determines which methods and similar members which scripts may call.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Whitelist
all()
abstract boolean
permitsConstructor
(@NotNull Constructor<?> constructor, @NotNull Object[] args) abstract boolean
permitsFieldGet
(@NotNull Field field, @NotNull Object receiver) abstract boolean
permitsFieldSet
(@NotNull Field field, @NotNull Object receiver, @Nullable Object value) abstract boolean
permitsMethod
(@NotNull Method method, @NotNull Object receiver, @NotNull Object[] args) Checks whether a given virtual method may be invoked.abstract boolean
permitsStaticFieldGet
(@NotNull Field field) abstract boolean
permitsStaticFieldSet
(@NotNull Field field, @Nullable Object value) abstract boolean
permitsStaticMethod
(@NotNull Method method, @NotNull Object[] args)
-
Constructor Details
-
Whitelist
public Whitelist()
-
-
Method Details
-
permitsMethod
public abstract boolean permitsMethod(@NotNull @NotNull Method method, @NotNull @NotNull Object receiver, @NotNull @NotNull Object[] args) 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 asStandardGroovySandbox
), not the whitelist.- Parameters:
method
- a method defined in the JVMreceiver
-this
, the receiver of the method callargs
- zero or more arguments- Returns:
- true to allow the method to be called, false to reject it
-
permitsConstructor
public abstract boolean permitsConstructor(@NotNull @NotNull Constructor<?> constructor, @NotNull @NotNull Object[] args) -
permitsStaticMethod
-
permitsFieldGet
-
permitsFieldSet
-
permitsStaticFieldGet
-
permitsStaticFieldSet
-
all
-