[java-identity-provider COMMIT] in /trunk: idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relying...

noreply at shibboleth.net noreply at shibboleth.net
Tue Oct 25 17:35:28 EDT 2016


Author: putmanb
Date: Tue Oct 25 17:35:27 2016
New Revision: 8543

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8543&view=rev
Log:
IDP-1075: Add config schema and parser for new metadata resolver options related to predicates

Added:
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filePredicatesDefaults.xml   (with props)
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filePredicatesNoDefaultRegistry.xml   (with props)
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/filePredicatesOptions.xml   (with props)
Modified:
    trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataProviderParser.java
    trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractReloadingMetadataProviderParser.java
    trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FilesystemMetadataParserTest.java
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/beans.xml
    trunk/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd

Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataProviderParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataProviderParser.java?rev=8543&r1=8542&r2=8543&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataProviderParser.java	(original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataProviderParser.java	Tue Oct 25 17:35:27 2016
@@ -185,6 +185,8 @@
                     StringSupport.trimOrNull(element.getAttributeNS(null, "requireValidMetadata")));
         }
 
+        processPredicateOptions(element, parserContext, builder);
+
         final List<Element> filters =
                 ElementSupport.getChildElements(element, METADATA_FILTER_ELEMENT_NAME);
 
@@ -210,4 +212,30 @@
             SpringSupport.parseCustomElements(trustEngines, parserContext);
         }
     }
+
+    /**
+     * Process predicate-related options.
+     * 
+     * @param element the current element being processed
+     * @param parserContext the current parser context
+     * @param builder the current bean definition builder
+     */
+    private void processPredicateOptions(final Element element, final ParserContext parserContext, 
+            final BeanDefinitionBuilder builder) {
+        
+        if (isPresentNotChaining(element, "satisfyAnyPredicates")) {
+            builder.addPropertyValue("satisfyAnyPredicates",
+                    StringSupport.trimOrNull(element.getAttributeNS(null, "satisfyAnyPredicates")));
+        }
+
+        if (isPresentNotChaining(element, "useDefaultPredicateRegistry")) {
+            builder.addPropertyValue("useDefaultPredicateRegistry",
+                    StringSupport.trimOrNull(element.getAttributeNS(null, "useDefaultPredicateRegistry")));
+        }
+
+        if (isPresentNotChaining(element, "criterionPredicateRegistryRef")) {
+            builder.addPropertyReference("criterionPredicateRegistry",
+                    StringSupport.trimOrNull(element.getAttributeNS(null, "criterionPredicateRegistryRef")));
+        }
+    }
 }

Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractReloadingMetadataProviderParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractReloadingMetadataProviderParser.java?rev=8543&r1=8542&r2=8543&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractReloadingMetadataProviderParser.java	(original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractReloadingMetadataProviderParser.java	Tue Oct 25 17:35:27 2016
@@ -55,6 +55,11 @@
                     StringSupport.trimOrNull(element.getAttributeNS(null, "indexesRef")));
         }
 
+        if (element.hasAttributeNS(null, "resolveViaPredicatesOnly")) {
+            builder.addPropertyValue("resolveViaPredicatesOnly",
+                    StringSupport.trimOrNull(element.getAttributeNS(null, "resolveViaPredicatesOnly")));
+        }
+
         if (element.hasAttributeNS(null, "refreshDelayFactor")) {
             builder.addPropertyValue("refreshDelayFactor",

[... 144 lines stripped ...]


More information about the commits mailing list