[java-identity-provider] branch main updated: Wire in class/bean relocator into global and service contexts.

Scott Cantor cantor.2 at osu.edu
Tue Sep 13 16:53:20 UTC 2022


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=d18fd8d877494e8f05185af76ec8159c5a4d317e

The following commit(s) were added to refs/heads/main by this push:
     new d18fd8d87 Wire in class/bean relocator into global and service contexts.
d18fd8d87 is described below

commit d18fd8d877494e8f05185af76ec8159c5a4d317e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Sep 13 12:53:17 2022 -0400

    Wire in class/bean relocator into global and service contexts.
---
 .../net/shibboleth/idp/conf/global-system.xml      | 19 +++++++++++++++++
 .../net/shibboleth/idp/conf/services-system.xml    | 24 ++++++++++++++--------
 idp-conf/src/test/resources/test/test-beans.xml    | 11 ----------
 3 files changed, 34 insertions(+), 20 deletions(-)

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 7ff8c0ca1..c6e7b246b 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
@@ -39,6 +39,25 @@
     <bean id="shibboleth.IdentifiableBeanPostProcessor"
         class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
 
+    <!-- This BeanFactoryPostProcessor rewrites class and parent references to relocated classes or beans. -->    
+    <bean id="shibboleth.RelocatedBeanFactoryPostProcessor"
+            class="net.shibboleth.ext.spring.util.RelocatedBeanFactoryPostProcessor">
+        <property name="classes">
+            <map>
+                <entry key="net.shibboleth.ext.spring.factory.PKCS11PrivateKeyFactoryBean"
+                    value="net.shibboleth.shared.spring.security.factory.PKCS11PrivateKeyFactoryBean" />
+                <entry key="net.shibboleth.ext.spring.factory.PrivateKeyFactoryBean"
+                    value="net.shibboleth.shared.spring.security.factory.PrivateKeyFactoryBean" />
+                <entry key="net.shibboleth.ext.spring.factory.PublicKeyFactoryBean"
+                    value="net.shibboleth.shared.spring.security.factory.PublicKeyFactoryBean" />
+                <entry key="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
+                    value="net.shibboleth.shared.spring.security.factory.X509CertificateFactoryBean" />
+                <entry key="net.shibboleth.ext.spring.factory.X509CertificateChainFactoryBean"
+                    value="net.shibboleth.shared.spring.security.factory.X509CertificateChainFactoryBean" />
+            </map>
+        </property>
+    </bean>
+
     <!-- This extends the original user-space resource list with the classpath-embedded message tree. -->
     <bean id ="ExtendedMessageSourceResources" class="net.shibboleth.ext.spring.factory.CombiningListFactoryBean"
           p:firstList-ref="#{'%{idp.message.resources:shibboleth.MessageSourceResources}'.trim()}" >
diff --git a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
index 927b32717..0b7e9292b 100644
--- a/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
+++ b/idp-conf-impl/src/main/resources/net/shibboleth/idp/conf/services-system.xml
@@ -26,6 +26,12 @@
         p:fallbackConfiguration="classpath:/logback.xml"
         p:reloadCheckDelay="%{idp.service.logging.checkInterval:PT0S}"
         p:failFast="%{idp.service.logging.failFast:%{idp.service.failFast:true}}" />
+        
+    <!-- BeanFactoryPostProcessors to apply. -->
+    <util:list id="shibboleth.BeanFactoryPostProcessors">
+        <ref bean="shibboleth.PropertySourcesPlaceholderConfigurer" />
+        <ref bean="shibboleth.RelocatedBeanFactoryPostProcessor" />
+    </util:list>
     
     <bean id="shibboleth.AttributeFilterService" class="net.shibboleth.ext.spring.service.ReloadableSpringService"
             depends-on="shibboleth.VelocityEngine"
@@ -33,7 +39,7 @@
             p:failFast="%{idp.service.attribute.filter.failFast:%{idp.service.failFast:false}}"
             p:reloadCheckDelay="%{idp.service.attribute.filter.checkInterval:PT0S}"
             p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-            p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer">
+            p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors">
         <constructor-arg name="claz" value="net.shibboleth.idp.attribute.filter.AttributeFilter" />
         <constructor-arg name="strategy">
             <bean class="net.shibboleth.idp.attribute.filter.spring.impl.AttributeFilterServiceStrategy"
@@ -56,7 +62,7 @@
             p:failFast="%{idp.service.attribute.resolver.failFast:%{idp.service.failFast:false}}"
             p:reloadCheckDelay="%{idp.service.attribute.resolver.checkInterval:PT0S}"
             p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-            p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer">
+            p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors">
         <constructor-arg name="claz" value="net.shibboleth.idp.attribute.resolver.AttributeResolver" />
         <constructor-arg name="strategy">
             <bean class="net.shibboleth.idp.attribute.resolver.spring.impl.AttributeResolverServiceStrategy"
@@ -79,7 +85,7 @@
 	        p:failFast="%{idp.service.attribute.registry.failFast:%{idp.service.failFast:false}}"
 	        p:reloadCheckDelay="%{idp.service.attribute.registry.checkInterval:PT0S}"
 	        p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-	        p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer">
+	        p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors">
 	    <constructor-arg name="claz" value="net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry" />
 	    <constructor-arg name="strategy">
             <bean class="net.shibboleth.idp.attribute.transcoding.impl.AttributeRegistryServiceStrategy">
@@ -114,7 +120,7 @@
         p:failFast="%{idp.service.nameidGeneration.failFast:%{idp.service.failFast:false}}"
         p:reloadCheckDelay="%{idp.service.nameidGeneration.checkInterval:PT0S}"
         p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-        p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer" />
+        p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors" />
     <!-- Auto-append system config file to resource set. -->
     <bean id ="ExtendedNameIdentifierGenerationResources" class="net.shibboleth.ext.spring.factory.CombiningListFactoryBean"
           p:firstList-ref="#{'%{idp.service.nameidGeneration.resources:shibboleth.NameIdentifierGenerationResources}'.trim()}" >
@@ -130,7 +136,7 @@
             p:failFast="%{idp.service.relyingparty.failFast:%{idp.service.failFast:false}}"
             p:reloadCheckDelay="%{idp.service.relyingparty.checkInterval:PT0S}"
             p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-            p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer">
+            p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors">
         <constructor-arg name="claz" value="net.shibboleth.idp.relyingparty.RelyingPartyConfigurationResolver" />
         <constructor-arg name="strategy">
             <bean class="net.shibboleth.ext.spring.service.ClassBasedServiceStrategy"
@@ -152,7 +158,7 @@
             p:serviceConfigurations-ref="ExtendedMetadataResolverResources"
             p:failFast="%{idp.service.metadata.failFast:%{idp.service.failFast:false}}"
             p:reloadCheckDelay="%{idp.service.metadata.checkInterval:PT0S}"
-            p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer"
+            p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors"
             p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor">
         <constructor-arg name="claz" value="org.opensaml.saml.metadata.resolver.MetadataResolver" />
         <constructor-arg name="strategy">
@@ -175,7 +181,7 @@
         p:failFast="%{idp.service.access.failFast:%{idp.service.failFast:true}}"
         p:reloadCheckDelay="%{idp.service.access.checkInterval:PT0S}"
         p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-        p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer" />
+        p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors" />
     <!-- Auto-append system config file to resource set. -->
     <bean id ="ExtendedAccessControlResources" class="net.shibboleth.ext.spring.factory.CombiningListFactoryBean"
           p:firstList-ref="#{'%{idp.service.access.resources:shibboleth.AccessControlResources}'.trim()}" >
@@ -193,7 +199,7 @@
           p:failFast="%{idp.service.cas.registry.failFast:%{idp.service.failFast:false}}"
           p:reloadCheckDelay="%{idp.service.cas.registry.checkInterval:PT0S}"
           p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-          p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer" />
+          p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors" />
     
     <!-- This default populates the service with an empty CAS registry as a substitute for a real config. -->
     <util:list id="shibboleth.DefaultCASServiceRegistryResources">
@@ -221,7 +227,7 @@
             p:failFast="%{idp.service.managedBean.failFast:%{idp.service.failFast:false}}"
             p:reloadCheckDelay="%{idp.service.managedBean.checkInterval:PT0S}"
             p:beanPostProcessors-ref="shibboleth.IdentifiableBeanPostProcessor"
-            p:beanFactoryPostProcessors-ref="shibboleth.PropertySourcesPlaceholderConfigurer">
+            p:beanFactoryPostProcessors-ref="shibboleth.BeanFactoryPostProcessors">
         <constructor-arg name="strategy">
             <bean class="net.shibboleth.ext.spring.service.ApplicationContextServiceStrategy" />
         </constructor-arg>
diff --git a/idp-conf/src/test/resources/test/test-beans.xml b/idp-conf/src/test/resources/test/test-beans.xml
index 1ba05366e..791073f11 100644
--- a/idp-conf/src/test/resources/test/test-beans.xml
+++ b/idp-conf/src/test/resources/test/test-beans.xml
@@ -9,17 +9,6 @@
 
     default-init-method="initialize" default-destroy-method="destroy">
 
-    <bean class="net.shibboleth.ext.spring.util.RelocatedBeanFactoryPostProcessor">
-        <property name="classes">
-            <map>
-                <entry key="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
-                    value="net.shibboleth.shared.spring.security.factory.X509CertificateFactoryBean" />
-                <entry key="net.shibboleth.ext.spring.factory.PrivateKeyFactoryBean"
-                    value="net.shibboleth.shared.spring.security.factory.PrivateKeyFactoryBean" />
-            </map>
-        </property>
-    </bean>
-
     <bean id="test.sp.X509Certificate" class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"
         p:resource="classpath:/credentials/sp.crt" />
 

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


More information about the commits mailing list