<div dir="ltr">I'd like to define an AttributeFilterPolicy that conditionally releases one of two attributes depending on whether one of the two exists or not. In pseudocode, essentially:<div><br>If ( defined attrFoo ) {<br>    permit attrFoo<br>}<br>else {<br>    permit attrBar<br>}</div><div><br></div><div>There's probably a best practice way to accomplish this, which isn't the following, and I would appreciate any suggestions.</div><div><br></div><div>My first (failed) attempt was something like:</div><div><br></div><div>    <AttributeFilterPolicy id="example"><br>        <PolicyRequirementRule xsi:type="Requester"<br>                value="<a href="https://example.com/sp">https://example.com/sp</a>" /><br><br>        <AttributeRule attributeID="attrFoo"><br>            <PermitValueRule xsi:type="NumberOfAttributeValues" attributeID="attrFoo" minimum="1" maximum="1" /><br>        </AttributeRule><br><br>        <AttributeRule attributeID="attrBar"><br>            <PermitValueRule xsi:type="NumberOfAttributeValues" attributeID="attrFoo" minimum="0" maximum="0" /><br>        </AttributeRule><br><br>    </AttributeFilterPolicy></div><div><br></div><div>But this resulted an error</div><div><br></div><div>ERROR [net.shibboleth.utilities.java.support.service.AbstractReloadableService:232] - Service 'shibboleth.AttributeFilterService': Reload for shibboleth.AttributeFilterService failed<br>net.shibboleth.utilities.java.support.service.ServiceException: Failed to load [file [/home/shib/idp/conf/attribute-filter.xml], class path resource [net/shibboleth/idp/conf/attribute-filter-system.xml]]<br>        at net.shibboleth.ext.spring.service.ReloadableSpringService.doReload(ReloadableSpringService.java:387)<br></div><div>[...]</div><div>Caused by: org.springframework.beans.PropertyBatchUpdateException: Failed properties: Property 'maximum' threw exception; nested exception is net.shibboleth.utilities.java.support.logic.ConstraintViolationException: max value must be > 0<br>        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:135)<br></div><div><br></div><div>The wiki page for NumberOfAttributeValuesConfiguration at <<a href="https://shibboleth.atlassian.net/wiki/spaces/IDP4/pages/1265631533/NumberOfAttributeValuesConfiguration">https://shibboleth.atlassian.net/wiki/spaces/IDP4/pages/1265631533/NumberOfAttributeValuesConfiguration</a>> says:</div><div>"The policy returns true iff the number of values is >= 'minimum' and  the number of values is  <= 'maximum'." and that maximum must be a, "Non-negative (>=0) Integer", so it seems like this should have worked? Or are the docs incorrect and it should really be "Positive (>0) Integer"? Or I'm missing something else (and moot, if there's a better way to accomplish this)?</div><div><br></div><div>This is IdP v4.2.1</div><div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="arial, sans-serif">Baron Fujimoto <<a href="mailto:baron@hawaii.edu" target="_blank">baron@hawaii.edu</a>> ::: UH Information Technology Services<br>minutas cantorum, minutas balorum, minutas carboratum descendus pantorum</font></div></div></div></div>