Class PluginOgnlAllowlist

java.lang.Object
com.atlassian.bamboo.struts.PluginOgnlAllowlist

public class PluginOgnlAllowlist extends Object
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 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

      public void disallowClass(@NotNull @NotNull Class<?> clazz)
    • registerPackagesAllowListForPlugin

      public void registerPackagesAllowListForPlugin(@NotNull @NotNull String moduleCompleteKey, @NotNull @NotNull ClassLoader pluginClassLoader, @NotNull @NotNull Set<String> packagesAllowlist)
    • clearClassesAllowListForPlugin

      public void clearClassesAllowListForPlugin(@NotNull @NotNull String moduleCompleteKey)
    • clearPackagesAllowListForPlugin

      public void clearPackagesAllowListForPlugin(@NotNull @NotNull String moduleCompleteKey)
    • isClassAllowed

      public boolean isClassAllowed(@NotNull @NotNull Class<?> clazz)
      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.