Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Table of Contents

Overview

The <ConditionScript> element contains a script (or a reference to a script) that ultimately applies an implementation of Predicate<EntityDescriptor> to > to a given entity descriptor.

The <ConditionScript> element implicitly iterates over all entity descriptors in the metadata filtering pipeline. For each entity descriptor, the parent parent <MetadataFilter> element acts on the input entity descriptor if (and only if) the predicate evaluates to true. The action taken depends on the type of metadata filter.

...

The <ConditionScript> element is a configuration element of type ScriptType.The following sections describe the attributes and elements of the ScriptType type.

Insert excerpt
ScriptTypeConfiguration
ScriptTypeConfiguration
nopaneltrue

Script Context

...

NameTypeDescription
inputEntityDescriptorThe EntityDescriptor to evaluate for exclusion
customObjectRefanyA custom object to inject into the script

Examples

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

...

A more complex example might use the custom object to help in the definition:

Code Block
languagexml
titleA trivial implementation of Function<T, Predicate<EntityDescriptor>>
<ConditionScript customObjectRef="BeanID">
    <Script>
    <![CDATA[
        "use strict";
        var someCondition = function(entityID) {
            // 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.getEntityID())) {
            result = custom["myFirstBean"].someFunction(input);
        } else {
            result = custom["mySecondBean"].someOtherFunction(input); 
        }
        result;
    ]]>
    </Script>
</ConditionScript>

...