Package com.atlassian.bamboo.struts
Class PluginOgnlAllowlist
java.lang.Object
com.atlassian.bamboo.struts.PluginOgnlAllowlist
Extends Struts' OGNL allowlist allowing to include classes and packages at runtime.
It can be used, for instance, by plugins to allowlist their classes when they are enabled.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearClassesAllowListForPlugin
(@NotNull String moduleCompleteKey) void
clearPackagesAllowListForPlugin
(@NotNull String moduleCompleteKey) void
disallowClass
(@NotNull Class<?> clazz) boolean
isClassAllowed
(@NotNull Class<?> clazz) Checks if a given class is allowlisted or if it belongs to an allowlisted package.void
registerClassesAllowListForPlugin
(@NotNull com.atlassian.plugin.Plugin plugin, @NotNull String moduleCompleteKey, @NotNull Set<String> pluginClassesAllowlist) void
registerPackagesAllowListForPlugin
(@NotNull String moduleCompleteKey, @NotNull ClassLoader pluginClassLoader, @NotNull Set<String> packagesAllowlist)
-
Constructor Details
-
PluginOgnlAllowlist
public PluginOgnlAllowlist()
-
-
Method Details
-
registerClassesAllowListForPlugin
public void registerClassesAllowListForPlugin(@NotNull @NotNull com.atlassian.plugin.Plugin plugin, @NotNull @NotNull String moduleCompleteKey, @NotNull @NotNull Set<String> pluginClassesAllowlist) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
disallowClass
-
registerPackagesAllowListForPlugin
public void registerPackagesAllowListForPlugin(@NotNull @NotNull String moduleCompleteKey, @NotNull @NotNull ClassLoader pluginClassLoader, @NotNull @NotNull Set<String> packagesAllowlist) -
clearClassesAllowListForPlugin
-
clearPackagesAllowListForPlugin
-
isClassAllowed
Checks if a given class is allowlisted or if it belongs to an allowlisted package. It checks only the dynamic configuration registered in this service, not the static struts configuration.- Parameters:
clazz
- the class which will evaluated- Returns:
- true if the class is allowlisted or if it belongs to an allowlisted package.
-