Tuscany
  1. Tuscany
  2. TUSCANY-3877

Policy appliesTo processing doesn't match the approach we now have of aggregating policy on endpoints/endpointreferences

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Java-SCA-2.0-M5
    • Fix Version/s: Java-SCA-2.0
    • Component/s: Java SCA Policy
    • Labels:
      None

      Description

      There are two issues with the current appliesTo processing in PolicyAppliesToBuilderImpl

      1/ For each element that holds a policy set it calculates the appliesTo nodes and checks that the current element is in the set. If not the policySet is removed from the element. The problem here is that it's checking the reference, service and binding nodes when it should be checking the endpoint and endpointreference nodes which hold the aggregated set of policy sets at this point

      2/ The spec says.

      "The
      400 policySet will apply to any child binding or implementation elements returned from the expression. So, for
      401 example, appliesTo="//binding.ws" will match any web service binding. If
      402 appliesTo="//binding.ws[@impl='axis']" then the policySet would apply only to web service bindings that
      403 have an @impl attribute with a value of 'axis'."

      Is not clear here if a policy set can appliesTo a service, reference or component element, rather than a binding or implementation element, in the expectation that it will be pushed down to the children. I can understand this being the case for attachTo but I don't understand why that would be needed for appliesTo.

        Activity

        Hide
        Simon Laws added a comment -

        The discussion continues here (http://www.mail-archive.com/dev%40tuscany.apache.org/msg16534.html) . We sought clarification from the policy spec lead which suggests that appliesTo can point to a reference or a service which is different from what Mike is says so still seeking to get the bottom line on that.

        Show
        Simon Laws added a comment - The discussion continues here ( http://www.mail-archive.com/dev%40tuscany.apache.org/msg16534.html ) . We sought clarification from the policy spec lead which suggests that appliesTo can point to a reference or a service which is different from what Mike is says so still seeking to get the bottom line on that.
        Hide
        Mike Edwards added a comment -

        I think that the key material is in section 4.15:

        1208 3. remove any policySet where the policySet does not apply to the target element.
        1209 It is not an error for a policySet to be attached to an element to which it doesn’t apply.

        So, no policySet gets used on a binding or on an implementation unless @appliesTo for that policySet includes that binding or implementation.

        So there is no "push down" in that sense. Ancestor policySets are gathered for consideration for a given binding or implementation (there is push down in that sense) but if they dont apply to the element under consideration, they are ignored.

        As it says here:

        391 Rather, policySets always apply to either binding instances or implementation elements regardless of
        392 where they are attached.

        PolicySets are applied either to bindings or to implementations - they have no use anywhere else - so a policySet saying @appliesTo="//service" (say) is going to get left on the floor.

        Show
        Mike Edwards added a comment - I think that the key material is in section 4.15: 1208 3. remove any policySet where the policySet does not apply to the target element. 1209 It is not an error for a policySet to be attached to an element to which it doesn’t apply. So, no policySet gets used on a binding or on an implementation unless @appliesTo for that policySet includes that binding or implementation. So there is no "push down" in that sense. Ancestor policySets are gathered for consideration for a given binding or implementation (there is push down in that sense) but if they dont apply to the element under consideration, they are ignored. As it says here: 391 Rather, policySets always apply to either binding instances or implementation elements regardless of 392 where they are attached. PolicySets are applied either to bindings or to implementations - they have no use anywhere else - so a policySet saying @appliesTo="//service" (say) is going to get left on the floor.

          People

          • Assignee:
            Simon Laws
            Reporter:
            Simon Laws
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development