Attributes and Predicates

Cantor, Scott cantor.2 at osu.edu
Tue May 6 09:51:42 EDT 2014


On 5/6/14, 4:21 AM, "Rod Widdowson" <rdw at steadingsoftware.com> wrote:
>
>Until 10 minutes ago, I thought that the encoders implemented
>AttributeResolverPlugin and hence would be covered by the
>DataConnector/AttributeDefintion work.  I see that they are not and
>further
>that there is no support for that.  Fixing this almost certainly involves
>giving the encode method of AttributeEncoder an extra parameter, being the
>context, and allowing it to return null (the calling code already handles
>that).  The rest is wiring.
>
>Shall I put in a case ?

I may already have, but I'll do it. I thought the context was already an
input, but I guess we can just add that. Or the other way to go is to push
it to the caller and make the Encoder interface implement Predicate
directly. It depends what the calling convention is for the encoders,
whether they can "not encode" without throwing. I can probably just take a
quick look at this today.

>My argument is that although having different parameter types to the
>Predicate _might_ make more sense in isolation it cannot do so in the
>round.

See my other response, that isn't what I'm suggesting. Rather, we can
inject Functions to do the lookups within the Predicate, the predicate's
job is just to compare the function's result against its criteria.

See the one I fixed up for RelyingPartyId predicate checks.

>I'd guess it's possible to create a Predicate<AttributeResolverContext>
>and
>a Predicate<SomeOtherContext> from each other by careful use of spring,
>but
>isn't it easier for our users to just have to implement
>Predicate<ProfileRequestContext> once?

Yes, that's what I did.

>The only counter example I might see is that the actual mechanism to
>locate
>(for instance) the RP identity might be different when resolving
>attributes
>to when encoding them.  In that case a different predicate would be
>required
>in the two places, but I would be inclined to suggest that in order to
>allow
>quick debugging we would want to type-garnish such predicates to allow
>config time discovery of misconfiguration

No, again, you don't need two predicates, you just need a lookup strategy
inside the predicate.

-- Scott




More information about the dev mailing list