SP Attribute Filter: type=basic:Script

Michael Nielsen michael.nielsen at cedargate.com
Sun May 27 13:54:01 EDT 2018


Hi!

I'd like to define a PermitValueRule on my SP as shown below (I think I have this mostly correct - at least the XML parses).

Shibd informs me: ERROR Shibboleth.AttributeFilter : error building PermitValueRule with type (basic:Script): Unknown plugin type.

The wiki page alludes to some functions not being supported in the attribute filter, but does not specify which are not.

Is the Script type supported on shibboleth 2.5.4?  If so, is there a particular plugin I need?

Or have I messed up the definition?

I would be very grateful for any help that you can offer.

                <AttributeFilter type="XML">
                        <afp:AttributeFilterPolicyGroup>
                                <afp:AttributeFilterPolicy id="restrictClientIds">
                                        <afp:PolicyRequirementRule xsi:type="basic:ANY" />
                                                <afp:AttributeRule attributeID="clientIds">
                                                        <afp:PermitValueRule xsi:type="basic:Script">
                                                                <basic:Script>
                                                                        <![CDATA[
                                                                        function evaluateRule(filterContext, attributeId, attributeValue) {
                                                                           const permittedClientIds = ["102","1001"];
                                                                           const reducer = (acc,v) => acc && permittedClients.includes(v);
                                                                           if (attributeId == null) return true;
                                                                           if (attributeValue == null) return true;
                                                                                var ca = attributeValue.split(";");
                                                                                var res = ca.reduce(reducer);
                                                                           return res;
                                                                        }
                                                                        evaluateRule(filterContext, attributeId, attributeValue);
                                                                        ]]>
                                                                </basic:Script>
                                                        </afp:PermitValueRule>
                                                </afp:AttributeRule>
                                </afp:AttributeFilterPolicy>
                        </afp:AttributeFilterPolicyGroup>
                </AttributeFilter>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20180527/d87bc7d5/attachment.html>


More information about the users mailing list