[java-idp-plugin-oidc-rp] branch main updated: Add property replacement and bean post processors into test FlowBuilder

Phil Smart philip.smart at jisc.ac.uk
Tue Jul 11 14:15:44 UTC 2023


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

philsmart pushed a commit to branch main
in repository java-idp-plugin-oidc-rp.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-rp.git;a=commit;h=ab9579b8e773710c7f4116fda3cd5b08cc253dc8

The following commit(s) were added to refs/heads/main by this push:
     new ab9579b  Add property replacement and bean post processors into test FlowBuilder
ab9579b is described below

commit ab9579b8e773710c7f4116fda3cd5b08cc253dc8
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Jul 11 15:14:10 2023 +0100

    Add property replacement and bean post processors into test FlowBuilder
---
 .../authn/test/spring/CustomFlowModelFlowBuilder.java      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/test/spring/CustomFlowModelFlowBuilder.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/test/spring/CustomFlowModelFlowBuilder.java
index e826874..ede1c76 100644
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/test/spring/CustomFlowModelFlowBuilder.java
+++ b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/test/spring/CustomFlowModelFlowBuilder.java
@@ -39,6 +39,7 @@ import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.AnnotationConfigUtils;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
 import org.springframework.context.support.ReloadableResourceBundleMessageSource;
 import org.springframework.core.io.Resource;
 import org.springframework.core.style.ToStringCreator;
@@ -115,8 +116,10 @@ import org.springframework.webflow.scope.FlowScope;
 import org.springframework.webflow.scope.ViewScope;
 import org.springframework.webflow.security.SecurityRule;
 
+import net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor;
 import net.shibboleth.ext.spring.resource.ConditionalResourceResolver;
 import net.shibboleth.ext.spring.util.AnnotationParameterNameDiscoverer;
+import net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor;
 
 /**
  * Copy of {@link FlowModelFlowBuilder} for setting the property placeholder prefix of <code>%{</code>, and
@@ -370,6 +373,17 @@ public class CustomFlowModelFlowBuilder extends AbstractFlowBuilder {
         flowContext.getBeanFactory().registerScope("flow", new FlowScope());
         flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
         
+        // Shibboleth change - auto-inject the property replacement bean.
+        final PropertySourcesPlaceholderConfigurer propertyConfigurer = new PropertySourcesPlaceholderConfigurer();
+        propertyConfigurer.setPlaceholderPrefix("%{");
+        propertyConfigurer.setPlaceholderSuffix("}");
+        propertyConfigurer.setEnvironment(flowContext.getEnvironment());
+        flowContext.addBeanFactoryPostProcessor(propertyConfigurer);
+        
+        // Shibboleth change - auto-inject our profile flow bean processors.
+        flowContext.getBeanFactory().addBeanPostProcessor(new IdentifiableBeanPostProcessor());
+        flowContext.getBeanFactory().addBeanPostProcessor(new ProfileActionBeanPostProcessor());
+        
         flowContext.getDefaultListableBeanFactory().setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer());
 
         // Ensure the current ClassLoader is used, or otherwise setting the ResourceLoader would suppress it

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


More information about the commits mailing list