[java-identity-provider] branch master updated: IDP-1640 - Override Spring WebFlow's ApplicationContext creation logic
Scott Cantor
cantor.2 at osu.edu
Fri Jul 17 18:18:14 UTC 2020
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b6dee17b90b3504690a6f5c2c0db01ae86a53790
The following commit(s) were added to refs/heads/master by this push:
new b6dee17b9 IDP-1640 - Override Spring WebFlow's ApplicationContext creation logic
b6dee17b9 is described below
commit b6dee17b90b3504690a6f5c2c0db01ae86a53790
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Jul 17 14:18:43 2020 -0400
IDP-1640 - Override Spring WebFlow's ApplicationContext creation logic
https://issues.shibboleth.net/jira/browse/IDP-1640
Defer SWF <bean-import> resource resolution.
---
.../profile/spring/factory/FlowModelFlowBuilder.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowModelFlowBuilder.java b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowModelFlowBuilder.java
index 290b0a06d..aa675d062 100644
--- a/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowModelFlowBuilder.java
+++ b/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/factory/FlowModelFlowBuilder.java
@@ -21,6 +21,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.stream.Collectors;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -319,11 +320,24 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
// internal helpers
private void initLocalFlowContext() {
- Resource[] contextResources = parseContextResources(getFlowModel().getBeanImports());
+ String[] contextResources = parseContextResources(getFlowModel().getBeanImports());
GenericApplicationContext flowContext = createFlowApplicationContext(contextResources);
setLocalContext(new LocalFlowBuilderContext(getContext(), flowContext));
}
+ /* Shibboleth change - pull out the resources as Strings and let the regular Spring logic resolve them */
+ private String[] parseContextResources(List<BeanImportModel> beanImports) {
+ if (beanImports != null && !beanImports.isEmpty()) {
+ final String[] resources = new String[beanImports.size()];
+ return beanImports.stream()
+ .map(BeanImportModel::getResource)
+ .collect(Collectors.toUnmodifiableList())
+ .toArray(resources);
+ }
+ return new String[0];
+ }
+
+ /*
private Resource[] parseContextResources(List<BeanImportModel> beanImports) {
if (beanImports != null && !beanImports.isEmpty()) {
Resource flowResource = flowModelHolder.getFlowModelResource();
@@ -341,8 +355,9 @@ public class FlowModelFlowBuilder extends AbstractFlowBuilder {
return new Resource[0];
}
}
+ */
- private GenericApplicationContext createFlowApplicationContext(Resource[] resources) {
+ private GenericApplicationContext createFlowApplicationContext(String[] resources) {
ApplicationContext parent = getContext().getApplicationContext();
GenericApplicationContext flowContext;
if (parent instanceof WebApplicationContext) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list