[java-identity-provider] branch main updated: IDP-1652 - Redesign handling of lists of descriptors

Scott Cantor cantor.2 at osu.edu
Tue Aug 18 16:22:36 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=6bd978a1cfa55b1a24210411e2cd5c75771cd4c9

The following commit(s) were added to refs/heads/main by this push:
       new  6bd978a1c IDP-1652 - Redesign handling of lists of descriptors
6bd978a1c is described below

commit 6bd978a1cfa55b1a24210411e2cd5c75771cd4c9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Aug 18 12:21:31 2020 -0400

    IDP-1652 - Redesign handling of lists of descriptors
    
    https://issues.shibboleth.net/jira/browse/IDP-1652
    
    Support auto-wired AuthenticationFlowDescriptors.
---
 .../impl/AuthenticationFlowDescriptorManager.java  | 46 ++++++++++++++++++++++
 .../shibboleth/idp/conf/general-authn-system.xml   |  6 +++
 .../net/shibboleth/idp/conf/global-system.xml      |  3 ++
 .../shibboleth/idp/conf/session-manager-system.xml |  2 +-
 .../net/shibboleth/idp/flows/authn/authn-beans.xml |  4 +-
 .../src/test/resources/test/test-cas-beans.xml     |  2 +-
 6 files changed, 59 insertions(+), 4 deletions(-)

diff --git a/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AuthenticationFlowDescriptorManager.java b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AuthenticationFlowDescriptorManager.java
new file mode 100644
index 000000000..ce4678fe4
--- /dev/null
+++ b/idp-authn-impl/src/main/java/net/shibboleth/idp/authn/impl/AuthenticationFlowDescriptorManager.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.idp.authn.impl;
+
+import java.util.Collection;
+
+import javax.annotation.Nullable;
+
+import org.springframework.beans.factory.annotation.Autowired;
+
+import net.shibboleth.ext.spring.util.IdentifiedComponentManager;
+import net.shibboleth.idp.authn.AuthenticationFlowDescriptor;
+import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
+
+/**
+ * Manager of {@link AuthenticationFlowDescriptor} objects. 
+ */
+public class AuthenticationFlowDescriptorManager extends IdentifiedComponentManager<AuthenticationFlowDescriptor> {
+
+    /**
+     * Constructor.
+     *
+     * @param freeObjects
+     */
+    @Autowired
+    public AuthenticationFlowDescriptorManager(
+            @Nullable @NonnullElements final Collection<AuthenticationFlowDescriptor> freeObjects) {
+        super(freeObjects);
+    }
+
+}
\ No newline at end of file
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/general-authn-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/general-authn-system.xml
index b89caf8e9..68f34c114 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/general-authn-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/general-authn-system.xml
@@ -15,6 +15,12 @@
 	<import resource="${idp.home}/conf/authn/authn-comparison.xml" />
 	<import resource="${idp.home}/conf/authn/general-authn.xml" />
 
+    <!-- Management bean to collect and expose AuthenticationFlowDescriptors. -->
+    
+    <bean id="shibboleth.AuthenticationFlowDescriptorManager"
+        class="net.shibboleth.idp.authn.impl.AuthenticationFlowDescriptorManager"
+        p:components="#{getObject('shibboleth.AvailableAuthenticationFlows')}" />
+
     <!-- A parent bean to default some of the flow boilerplate. -->
 
     <bean id="shibboleth.AuthenticationFlow" abstract="true"
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
index 49f2bb3e5..fd443d9b4 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/global-system.xml
@@ -12,6 +12,9 @@
        default-init-method="initialize"
        default-destroy-method="destroy">
 
+    <!-- Needed to allow for auto-wiring of descriptors and other componnents. -->
+    <context:annotation-config />
+
     <bean id="shibboleth.PropertySourcesPlaceholderConfigurer"
         class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"
         p:placeholderPrefix="%{" p:placeholderSuffix="}" />
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/session-manager-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/session-manager-system.xml
index c0136b776..12594c5e7 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/session-manager-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/session-manager-system.xml
@@ -63,7 +63,7 @@
             depends-on="shibboleth.OpenSAMLConfig"
             p:httpServletRequest-ref="shibboleth.HttpServletRequest"
             p:httpServletResponse-ref="shibboleth.HttpServletResponse"
-            p:authenticationFlowDescriptors-ref="shibboleth.AvailableAuthenticationFlows"
+            p:authenticationFlowDescriptors="#{@'shibboleth.AuthenticationFlowDescriptorManager'.getComponents()}"
             p:cookieManager-ref="shibboleth.CookieManager"
             p:storageService-ref="#{'%{idp.session.StorageService:shibboleth.ClientSessionStorageService}'.trim()}"
             p:consistentAddressCondition="#{getObject('%{idp.session.consistentAddressCondition:}'.trim()) ?:
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/authn-beans.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/authn-beans.xml
index 294914437..ebcebd65c 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/authn-beans.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/flows/authn/authn-beans.xml
@@ -20,8 +20,8 @@
     
     <bean id="PopulateAuthenticationContext"
         class="net.shibboleth.idp.authn.impl.PopulateAuthenticationContext" scope="prototype"
-        p:availableFlows-ref="shibboleth.AvailableAuthenticationFlows"
-        p:potentialFlows="#{@'shibboleth.AvailableAuthenticationFlows'.?[id matches 'authn/(' + '%{idp.authn.flows:}'.trim() + ')']}"
+        p:availableFlows="#{@'shibboleth.AuthenticationFlowDescriptorManager'.getComponents()}"
+        p:potentialFlows="#{@'shibboleth.AuthenticationFlowDescriptorManager'.getComponents().?[id matches 'authn/(' + '%{idp.authn.flows:}'.trim() + ')']}"
         p:principalEvalPredicateFactoryRegistry-ref="shibboleth.AuthnComparisonRegistry"
         p:fixedEventLookupStrategy="#{getObject('shibboleth.FixedAuthenticationEventStrategy')}" />
 
diff --git a/idp-conf/src/test/resources/test/test-cas-beans.xml b/idp-conf/src/test/resources/test/test-cas-beans.xml
index 4d71e5165..2d0ae8dca 100644
--- a/idp-conf/src/test/resources/test/test-cas-beans.xml
+++ b/idp-conf/src/test/resources/test/test-cas-beans.xml
@@ -13,7 +13,7 @@
           depends-on="shibboleth.OpenSAMLConfig"
           p:httpServletRequest-ref="shibboleth.HttpServletRequest"
           p:httpServletResponse-ref="shibboleth.HttpServletResponse"
-          p:authenticationFlowDescriptors="#{@'shibboleth.AvailableAuthenticationFlows'.?[id matches 'authn/(' + '%{idp.authn.flows:}'.trim() + ')']}"
+          p:authenticationFlowDescriptors="#{@'shibboleth.AuthenticationFlowDescriptorManager'.getComponents().?[id matches 'authn/(' + '%{idp.authn.flows:}'.trim() + ')']}"
           p:cookieManager-ref="shibboleth.CookieManager"
           p:storageService-ref="shibboleth.StorageService"
           p:consistentAddress="%{idp.session.consistentAddress:true}"

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


More information about the commits mailing list