Class ClusterAllowList

java.lang.Object
org.exoplatform.services.ispn.ClusterAllowList

public final class ClusterAllowList extends Object
The classes a node deserializes from the cluster, one list for every path an object arrives by: JGroups' own deserialization, through the "jgroups.deserialization.filter" system property set before any channel is created; and the cache marshaller (ClusterJavaSerializationMarshaller), through getInfinispanAllowList(), which also checks what it writes. The RPC services marshal their commands and replies with that marshaller.

In order: Infinispan's built-in denials, the classes Infinispan always accepts, the platform's packages, the JDK types that cached values and exceptions carry with their serializable superclasses, the entries of the "exo.cluster.serialization.allowList" property, then everything else denied.

  • Field Details

    • ALLOW_LIST_PROPERTY

      public static final String ALLOW_LIST_PROPERTY
      The entries integrators add to the list, comma-separated: a class name, pkg.* (the package) or pkg.** (with its subpackages).
      See Also:
    • JGROUPS_FILTER_PROPERTY

      public static final String JGROUPS_FILTER_PROPERTY
      The system property JGroups reads its deserialization filter from, once.
      See Also:
  • Method Details

    • getInstance

      public static ClusterAllowList getInstance()
      Builds the list of this node from the "exo.cluster.serialization.allowList" property on first call, then sets the "jgroups.deserialization.filter" system property and logs the digest of the list, which must be the same on every node.
      Returns:
      the list of this node
      Throws:
      IllegalStateException - if the property is malformed, or if a system property would widen Infinispan's allow-list only
    • getFilterPattern

      public String getFilterPattern()
      Returns:
      the list in the syntax of the JDK serialization filters
    • getFilter

      public ObjectInputFilter getFilter()
      Returns:
      a filter applying the list to a plain ObjectInputStream: no cluster path reads with one, the tests check the list through it
    • getInfinispanAllowList

      public org.infinispan.commons.configuration.ClassAllowList getInfinispanAllowList()
      Returns:
      the list as Infinispan's class names and regular expressions, to which Infinispan adds its own denials and the classes it always accepts
    • getDigest

      public String getDigest()
      Returns:
      the first 16 hexadecimal digits of the SHA-256 digest of the list, which Ops compare across nodes