Class EnumeratingWhitelist
java.lang.Object
org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist
org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.EnumeratingWhitelist
- Direct Known Subclasses:
StaticWhitelist
A whitelist based on listing signatures and searching them. Lists of signatures should not change
from invocation to invocation.
If that's a need it is better to directly extend Whitelist
and roll a custom implementation OR
extend ProxyWhitelist and add some custom delegates.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static final class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract List<EnumeratingWhitelist.FieldSignature>
static @NotNull String
static @NotNull String
protected abstract List<EnumeratingWhitelist.MethodSignature>
protected abstract List<EnumeratingWhitelist.NewSignature>
final boolean
permitsConstructor
(Constructor<?> constructor, Object[] args) final boolean
permitsFieldGet
(Field field, Object receiver) final boolean
permitsFieldSet
(Field field, Object receiver, Object value) final boolean
permitsMethod
(Method method, Object receiver, Object[] args) Checks whether a given virtual method may be invoked.final boolean
permitsStaticFieldGet
(Field field) final boolean
permitsStaticFieldSet
(Field field, Object value) final boolean
permitsStaticMethod
(Method method, Object[] args) protected abstract List<EnumeratingWhitelist.FieldSignature>
protected abstract List<EnumeratingWhitelist.MethodSignature>
-
Constructor Details
-
EnumeratingWhitelist
public EnumeratingWhitelist()
-
-
Method Details
-
methodSignatures
-
newSignatures
-
staticMethodSignatures
-
fieldSignatures
-
staticFieldSignatures
-
permitsMethod
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 asStandardGroovySandbox
), not the whitelist.- Specified by:
permitsMethod
in classWhitelist
- 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
- Specified by:
permitsConstructor
in classWhitelist
-
permitsStaticMethod
- Specified by:
permitsStaticMethod
in classWhitelist
-
permitsFieldGet
- Specified by:
permitsFieldGet
in classWhitelist
-
permitsFieldSet
- Specified by:
permitsFieldSet
in classWhitelist
-
permitsStaticFieldGet
- Specified by:
permitsStaticFieldGet
in classWhitelist
-
permitsStaticFieldSet
- Specified by:
permitsStaticFieldSet
in classWhitelist
-
getName
-
getName
-