[java-identity-provider] branch main updated: Make configuration "optional".

Scott Cantor cantor.2 at osu.edu
Thu Aug 27 22:21:33 UTC 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=571de0c517c0cdd4dc9cde888766fad6a0de413b

The following commit(s) were added to refs/heads/main by this push:
       new  571de0c51 Make configuration "optional".
571de0c51 is described below

commit 571de0c517c0cdd4dc9cde888766fad6a0de413b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Aug 27 18:21:18 2020 -0400

    Make configuration "optional".
---
 .../idp/authn/impl/ValidateUserAgentAddress.java           | 14 +++++++++-----
 .../shibboleth/idp/flows/authn/ipaddress-authn-beans.xml   |  6 +++---
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
index fe012c123..66f24cac3 100644
--- a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/ValidateUserAgentAddress.java
@@ -88,14 +88,18 @@ public class ValidateUserAgentAddress extends AbstractValidationAction {
      * 
      * @param newMappings the IP range(s) to authenticate as particular principals
      */
-    public void setMappings(@Nonnull @NonnullElements final Map<String,Collection<IPRange>> newMappings) {
+    public void setMappings(@Nullable @NonnullElements final Map<String,Collection<IPRange>> newMappings) {
         ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
         
-        mappings = new HashMap<>(newMappings.size());
-        for (final Map.Entry<String,Collection<IPRange>> e : newMappings.entrySet()) {
-            if (!Strings.isNullOrEmpty(e.getKey())) {
-                mappings.put(e.getKey(), List.copyOf(e.getValue()));
+        if (newMappings != null) {
+            mappings = new HashMap<>(newMappings.size());
+            for (final Map.Entry<String,Collection<IPRange>> e : newMappings.entrySet()) {
+                if (!Strings.isNullOrEmpty(e.getKey())) {
+                    mappings.put(e.getKey(), List.copyOf(e.getValue()));
+                }
             }
+        } else {
+            mappings = Collections.emptyMap();
         }
     }
     
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/ipaddress-authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/ipaddress-authn-beans.xml
index 6ccb669f7..eef5e8e34 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/ipaddress-authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/ipaddress-authn-beans.xml
@@ -18,15 +18,15 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="%{idp.home}/conf/authn/ipaddress-authn-config.xml" />
+    <import resource="conditional:%{idp.home}/conf/authn/ipaddress-authn-config.xml" />
     
     <bean id="ExtractUserAgentAddress" class="net.shibboleth.idp.authn.impl.ExtractUserAgentAddress" scope="prototype"
         p:httpServletRequest-ref="shibboleth.HttpServletRequest"
         p:trim="true"
-        p:transforms-ref="shibboleth.authn.IPAddress.Transforms" />
+        p:transforms="#{getObject('shibboleth.authn.IPAddress.Transforms')}" />
         
     <bean id="ValidateUserAgentAddress" class="net.shibboleth.idp.authn.impl.ValidateUserAgentAddress" scope="prototype"
-        p:mappings-ref="shibboleth.authn.IPAddress.Mappings"
+        p:mappings="#{getObject('shibboleth.authn.IPAddress.Mappings')}"
         p:addDefaultPrincipals="#{getObject('shibboleth.authn.IPAddress.addDefaultPrincipals') ?: true}"
         p:resultCachingPredicate="#{getObject('shibboleth.authn.IPAddress.resultCachingPredicate')}" />
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list