scripting policy requirement rules
Chad La Joie
lajoie at shibboleth.net
Tue Jan 24 23:24:06 GMT 2012
I seem to recall a bug with related to the use of the script file for
scripted filter plugins, you might want to check Jira.
That said, you might also want to try turning on debug logging for the
org.mozilla package. I don't know if they log anything during script
compilation or not but that would be the first thing to try.
On 1/24/12 4:28 PM, Liam Hoekenga wrote:
> I'm trying to use a script for a policy requirement rule. If I follow
> the example in the wiki, the IdP loads and works...
>
> <AttributeFilterPolicy id="scriptedRuleTest">
> <PolicyRequirementRule xsi:type="basic:Script">
> <basic:Script>
> <![CDATA[
> function evaluateRule(filterContext, attributeId, attributeValue) {
> if (attributeId == null) return true;
> if (attributeValue == null) return true;
> return
> filterContext.getAttributeRequestContext().getAttributes().get("uid").equals("jsmith");
> }
> evaluateRule(filterContext, attributeId, attributeValue);
> ]]>
> </basic:Script>
> </PolicyRequirementRule>
>
>
> The wiki suggests that I should also be able to use ScriptFile. If I
> try this, however...
>
> <AttributeFilterPolicy id="scriptedRuleTest">
> <PolicyRequirementRule xsi:type="basic:Script">
> <basic:ScriptFile>/opt/shibboleth-idp/script/testRule.js</basic:ScriptFile>
> </PolicyRequirementRule>
>
> I get this...
>
>
> 16:17:08.890 - - TRACE
> [edu.internet2.middleware.shibboleth.common.config.BaseSpringNamespaceHandler:115]
> - Attempting to find parser with element name:
> {urn:mace:shibboleth:2.0:afp}AttributeFilterPolicy
> 16:17:08.890 - - INFO
> [edu.internet2.middleware.shibboleth.common.config.attribute.filtering.AttributeFilterPolicyBeanDefinitionParser:72]
> - Parsing configuration for attribute filter policy scriptedRuleTest
> 16:17:08.890 - - TRACE
> [edu.internet2.middleware.shibboleth.common.config.BaseSpringNamespaceHandler:109]
> - Attempting to find parser for element of type:
> {urn:mace:shibboleth:2.0:afp:mf:basic}Script
> 16:17:08.892 - - ERROR
> [edu.internet2.middleware.shibboleth.common.config.BaseService:188] -
> Configuration was not loaded for shibboleth.AttributeFilterEngine
> service, error creating components. The root cause of this error was:
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
> 16:17:08.895 - - TRACE
> [edu.internet2.middleware.shibboleth.common.config.BaseService:191] -
> Full stacktrace is:
> org.opensaml.util.resource.ResourceException: Unable to load Spring
> bean registry with configuration resources
>
>
> Suggestions? IDP 2.3.5 w/ oracle jave 1.6.0_29
>
> Liam
> --
> To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
More information about the users
mailing list