[java-idp-plugin-duo] 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:04:08 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-duo.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-duo.git;a=commit;h=86bb2147dfb32d206a8ec5b122922abad8d86750
The following commit(s) were added to refs/heads/main by this push:
new 86bb214 Add property replacement and bean post processors into test FlowBuilder
86bb214 is described below
commit 86bb2147dfb32d206a8ec5b122922abad8d86750
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Jul 11 15:03:02 2023 +0100
Add property replacement and bean post processors into test FlowBuilder
---
.../plugin/authn/spring/CustomFlowModelFlowBuilder.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/spring/CustomFlowModelFlowBuilder.java b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/spring/CustomFlowModelFlowBuilder.java
index 9db1b2f..97798aa 100644
--- a/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/spring/CustomFlowModelFlowBuilder.java
+++ b/idp-duo-impl/src/test/java/net/shibboleth/idp/plugin/authn/spring/CustomFlowModelFlowBuilder.java
@@ -40,6 +40,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;
@@ -116,6 +117,8 @@ import org.springframework.webflow.scope.FlowScope;
import org.springframework.webflow.scope.ViewScope;
import org.springframework.webflow.security.SecurityRule;
+import net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor;
+import net.shibboleth.shared.spring.config.IdentifiableBeanPostProcessor;
import net.shibboleth.shared.spring.resource.ConditionalResourceResolver;
import net.shibboleth.shared.spring.util.AnnotationParameterNameDiscoverer;
@@ -395,8 +398,19 @@ public class CustomFlowModelFlowBuilder extends AbstractFlowBuilder {
flowContext.getBeanFactory().registerScope("view", new ViewScope());
flowContext.getBeanFactory().registerScope("flow", new FlowScope());
flowContext.getBeanFactory().registerScope("conversation", new ConversationScope());
-
flowContext.getDefaultListableBeanFactory().setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer());
+
+ // 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());
+
// Ensure the current ClassLoader is used, or otherwise setting the ResourceLoader would suppress it
final ClassLoader classLoaderToUse = flowContext.getClassLoader();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list