Class AbstractWhitelist
java.lang.Object
org.jenkinsci.plugins.scriptsecurity.sandbox.Whitelist
org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.AbstractWhitelist
- All Implemented Interfaces:
ExtensionPoint
Convenience whitelist base class that denies everything by default.
Thus you need only override things you wish to explicitly allow.
Also reduces the risk of incompatibilities in case further
abstract
methods are added to Whitelist
.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
permitsConstructor
(Constructor<?> constructor, Object[] args) boolean
permitsFieldGet
(Field field, Object receiver) boolean
permitsFieldSet
(Field field, Object receiver, Object value) boolean
permitsMethod
(Method method, Object receiver, Object[] args) Checks whether a given virtual method may be invoked.boolean
permitsStaticFieldGet
(Field field) boolean
permitsStaticFieldSet
(Field field, Object value) boolean
permitsStaticMethod
(Method method, Object[] args)
-
Constructor Details
-
AbstractWhitelist
public AbstractWhitelist()
-
-
Method Details
-
permitsMethod
public boolean permitsMethod(@NonNull Method method, @NonNull Object receiver, @NonNull 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 asGroovySandbox
), 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
-
permitsFieldSet
- Specified by:
permitsFieldSet
in classWhitelist
-
permitsFieldGet
- Specified by:
permitsFieldGet
in classWhitelist
-
permitsStaticFieldSet
- Specified by:
permitsStaticFieldSet
in classWhitelist
-
permitsStaticFieldGet
- Specified by:
permitsStaticFieldGet
in classWhitelist
-