Class XACMLUtils

java.lang.Object
org.opencastproject.authorization.xacml.XACMLUtils

public final class XACMLUtils extends Object
Utility implementation for dealing with XACML data.
  • Field Details

    • RULE_COMBINING_ALG

      public static final String RULE_COMBINING_ALG
      XACML rule for combining policies
      See Also:
    • ACTION_IDENTIFIER

      public static final String ACTION_IDENTIFIER
      XACML urn for actions
      See Also:
    • RESOURCE_IDENTIFIER

      public static final String RESOURCE_IDENTIFIER
      XACML urn for resources
      See Also:
    • SUBJECT_IDENTIFIER

      public static final String SUBJECT_IDENTIFIER
      XACML urn for subject
      See Also:
    • SUBJECT_ROLE_IDENTIFIER

      public static final String SUBJECT_ROLE_IDENTIFIER
      XACML urn for roles
      See Also:
    • XACML_STRING_EQUAL

      public static final String XACML_STRING_EQUAL
      XACML urn for string equality
      See Also:
    • XACML_STRING_IS_IN

      public static final String XACML_STRING_IS_IN
      XACML urn for string equality
      See Also:
    • W3C_STRING

      public static final String W3C_STRING
      W3C String data type
      See Also:
    • ISSUER

      public static final String ISSUER
      The policy assertion issuer
      See Also:
    • jBossXacmlJaxbContext

      protected static javax.xml.bind.JAXBContext jBossXacmlJaxbContext
      The JAXB Context to use for marshaling XACML security policy documents
  • Method Details

    • parseXacml

      public static org.opencastproject.security.api.AccessControlList parseXacml(InputStream xacml) throws XACMLParsingException
      Parses a XACML into an AccessControlList.

      Only rules which follow the structure of those created by getXacml(MediaPackage, AccessControlList) may be successfully parsed. All other rules are ignored.

      Parameters:
      xacml - the XACML to parse
      Returns:
      the ACL, never null
      Throws:
      XACMLParsingException - if parsing fails
    • getXacml

      public static String getXacml(org.opencastproject.mediapackage.MediaPackage mediapackage, org.opencastproject.security.api.AccessControlList accessControlList) throws javax.xml.bind.JAXBException
      Builds an xml string containing the xacml for the mediapackage.
      Parameters:
      mediapackage - the mediapackage
      accessControlList - the tuples of roles to actions
      Returns:
      Throws:
      javax.xml.bind.JAXBException