AttributeFilterScript

Namespace: urn:mace:shibboleth:2.0:metadata
Schema: http://shibboleth.net/schema/idp/shibboleth-metadata.xsd

Overview

The <AttributeFilterScript> element contains a script (or a reference to a script) that ultimately applies an implementation of Predicate<Attribute> to a given entity attribute. The containing filter implicitly iterates over all entity attributes in the metadata pipeline. For each entity attribute, the entity attribute is removed from the input stream if (and only if) the predicate evaluates to false.

Reference

The <AttributeFilterScript> element is a configuration element of type ScriptType.

Script Context

Name

Type

Description

Name

Type

Description

input

Attribute

The Attribute to evaluate for exclusion

customObjectRef

any

A custom object to inject into the script

Examples

The following trivial implementation of Predicate<Attribute> always returns false regardless of the input argument:

A trivial implementation of Predicate<Attribute>
<AttributeFilterScript> <Script> <![CDATA[ false; ]]> </Script> </AttributeFilterScript>

A more complex example might use the custom object to help the operation.

<AttributeFilterScript> <Script> <![CDATA[ "use strict"; var someCondition = function(attributeValueCount) { // Good stuff } var result; // CustomObjectRef points to a <util:map> where the key is a string and the value is an 'interesting bean' if (someCondition(input.getValues.size()) { result = custom["myAttributePredicate"].someFunction(input); } else { result = custom["myOtherAttributePredicate"].someOtherFunction(input); } result; ]]> </Script> </AttributeFilterScript>

Â