ScopedAttributePredicate
Description
Environment
Attachments
Activity
In the end I just wired this into the existing SimpleAttributePredicate. The semantic should mostly match what you're expecting and doesn't change the existing logic that treats scoped values as strings if no scope is supplied to match against.
Well, this is getting way uglier than I expected so I’m going to back off and just implement the simpler fix. I’ll inherit so the code’s not duplicated but I will limit it to one scope as this code does.
But it is important to match value@scope together.
An AND wrapped around both classes does that, but again that gets crazy once you have multiple scopes mixed in for specific values. It will be better to just use Pair in the values of the map so that each matching rule includes both. It’s slightly more wiring in the simple case but much less wiring in the more complex cases.
I guess alternatively…it’s probably best to bite the bullet and just use the Pair class to capture both value and scope in the map values. Anything else will get super ugly to enforce combinations of specific values and scopes and that’s certainly a potential need.
If we would need a predicate for multiple scopes, I would indeed create another bean and add them in an OR-relation.
But it is important to match value@scope together.
<bean id="student_universityA.com" class="be.kuleuven.ccis.idp.util.ScopedAttributePredicate" p:useUnfilteredAttributes="true">
<property name="scope" value="universityA.com"/>
<property name="attributeValueMap">
<map>
<entry key="eduPersonScopedAffiliation">
<list>
<value>student</value>
</list>
</entry>
</map>
</property>
</bean>
<bean id="student_alum_universityB.com" class="be.kuleuven.ccis.idp.util.ScopedAttributePredicate" p:useUnfilteredAttributes="true">
<property name="scope" value="universityB.com"/>
<property name="attributeValueMap">
<map>
<entry key="eduPersonScopedAffiliation">
<list>
<value>student</value>
<value>alum</value>
</list>
</entry>
</map>
</property>
</bean>
<bean id="shibboleth.context-check.app" parent="shibboleth.Conditions.OR">
<constructor-arg>
<list>
<ref bean="student_universityA.com"/>
<ref bean="student_alum_universityB.com"/>
</list>
</constructor-arg>
</bean>
Add support for ScopedAttributePredicate