template attribute definition possible bug?

Cantor, Scott cantor.2 at osu.edu
Tue Nov 3 15:21:36 EST 2015


On 11/3/15, 3:00 PM, "users on behalf of Athanasios Douitsis" <users-bounces at shibboleth.net on behalf of aduitsis at gmail.com> wrote:



>    <resolver:AttributeDefinition xsi:type="Template" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
>        id="testing">
>        <resolver:Dependency ref="template1" />
>        <Template>
>                  <![CDATA[${whatever}:${template1}]]>
>                </Template>
>        <SourceAttribute>whatever</SourceAttribute>
>        <SourceAttribute>template1</SourceAttribute>
>    </resolver:AttributeDefinition>
>
>Something like the above actually works and produces val1:val1 where val1 is the value of template1.

Only if "whatever" also contains val1. It doesn't double anything. It runs the template engine X times where X = the number of values in the source attributes. Each run contains the nth value from each source attribute populated into the variables in the Velocity context. The names of the variables are drawn from the SourceAttribute elements, in this case, "whatever" and "template1".

The actual values in the value set are derived by asking all the Dependencies (in this case template1) for the values of each source attribute and merging them together.

I assume it merges them in the order the Dependencies are specified, but I would have to read the code, and I'm only going to look at V3 at this point.

> So basically, this explains why I cannot use two dependencies at the same time.

I do. Many of us do.

> It would seem that there's something to the effect that the template cannot tell which source attribute comes from where, so first time it gets all values from the first dependency, second time from the second and so on.

Well, no, it can't. The source attributes are NOT namespaced by the dependencies. It's one global namespace of attribute IDs.

Whether you use common attribute names across data connectors depends on the merging behavior you're after.

-- Scott



More information about the users mailing list