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 a given entity descriptor.
...
The <ConditionScript>
may be a child element within the following metadata filter types:
Reference
The <ConditionScript>
element is a configuration element of type ScriptType
.excerpt-
Include Page | ||||
---|---|---|---|---|
|
...
Script Context
Name | Type | Description |
---|---|---|
| The EntityDescriptor to evaluate for exclusion | |
| any | A custom object to inject into the script |
Examples
The following trivial implementation of Predicate<EntityDescriptor> always returns false regardless of the input
argument:
A trivial implementation of Predicate<EntityDescriptor>
Code Block | ||||
---|---|---|---|---|
| ||||
<ConditionScript> <Script> <![CDATA[ "use strict"; false; ]]> </Script> </ConditionScript> |
A more complex example might use the custom
object to help the operation.
Use of custom object
Code Block | ||||
---|---|---|---|---|
| ||||
<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> |