Class Whitelist
java.lang.Object
org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
AbstractWhitelist
,AclAwareWhitelist
,BlanketWhitelist
,ClassLoaderWhitelist
,EnumeratingWhitelist
,ProxyWhitelist
Determines which methods and similar members which scripts may call.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Whitelist
all()
Checks for all whitelists registered asExtension
s and aggregates them.abstract boolean
permitsConstructor
(Constructor<?> constructor, Object[] args) abstract boolean
permitsFieldGet
(Field field, Object receiver) abstract boolean
permitsFieldSet
(Field field, Object receiver, Object value) abstract boolean
permitsMethod
(Method method, Object receiver, Object[] args) Checks whether a given virtual method may be invoked.abstract boolean
permitsStaticFieldGet
(Field field) abstract boolean
permitsStaticFieldSet
(Field field, Object value) abstract boolean
permitsStaticMethod
(Method method, Object[] args)
-
Constructor Details
-
Whitelist
public Whitelist()
-
-
Method Details
-
permitsMethod
public abstract boolean permitsMethod(@NonNull Method method, @NonNull Object receiver, @NonNull 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 asGroovySandbox
), 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(@NonNull Constructor<?> constructor, @NonNull Object[] args) -
permitsStaticMethod
-
permitsFieldGet
-
permitsFieldSet
-
permitsStaticFieldGet
-
permitsStaticFieldSet
-
all
Checks for all whitelists registered asExtension
s and aggregates them.- Returns:
- an aggregated default list
-