Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-2464

PolicyValidationException Policy set does not apply to extension type

    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      There is a bug in the applicable policy set processing in PolicyComputationUtils which may cause a PolicyValidationException. Method addApplicablePolicySets(PolicySet, Document, int) has the following code:

      String policySetPrefix = POLICYSET_PREFIX + prefixCount++;
      String appPolicyAttrPrefix = APPLICABLE_POLICYSET_ATTR_PREFIX;

      policySetPrefix =
      declareNamespace((Element)aResultNode, policySetPrefix, policySet.getName()
      .getNamespaceURI());

      This code calls declareNamespace() to handle binding a prefix to the policy set's namespace. It generates the prefix though it has no idea whether the prefix is needed (it isn't needed if there is an existing prefix bound to the namespace). It generates the prefix using a counter which recycles to 1 each time an applicable policy set is added to the document. This means there is a possibility of reusing the same prefix for two different namespaces. If that happens, some of the applicable policy sets will have the wrong namespace. This may cause references to the policy set within the composite to fail validation due to the namespace mismatch.

      Attachments

        1. jira.patch
          5 kB
          Greg Dritschler

        Activity

          People

            lresende Luciano Resende
            gregdritschler Greg Dritschler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: