From a10c0d683c5d495fd636b377249da7f0c42f7a53 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 21 Dec 2012 14:11:51 -0500 Subject: [PATCH] Upgrade Spring Security and switch to snapshot label Issue: SWF-1581 --- build.properties | 5 +- pom.xml | 2 +- spring-binding/.classpath | 35 ++++-- spring-binding/.project | 10 ++ spring-binding/pom.xml | 12 +- .../el/ELExpressionParserTests.java | 20 +-- spring-faces/.classpath | 77 ++++++------ spring-faces/.project | 41 ++++--- spring-faces/ivy.xml | 4 +- spring-faces/pom.xml | 18 ++- .../faces/security/AbstractAuthorizeTag.java | 15 +-- spring-js-resources/.classpath | 14 +-- spring-js-resources/.project | 36 +++--- .../.settings/org.eclipse.jdt.core.prefs | 8 +- spring-js-resources/pom.xml | 2 +- spring-js/.classpath | 63 ++++++---- spring-js/.project | 38 +++--- spring-js/pom.xml | 2 +- .../booking-faces/.classpath | 18 ++- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org.eclipse.wst.common.component | 22 ++-- spring-webflow-samples/booking-faces/pom.xml | 9 +- .../webapp/WEB-INF/config/security-config.xml | 4 +- spring-webflow-samples/booking-mvc/.classpath | 21 ++-- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org.eclipse.wst.common.component | 27 ++-- spring-webflow-samples/booking-mvc/pom.xml | 20 ++- .../webapp/WEB-INF/config/security-config.xml | 4 +- .../booking-portlet-faces/.classpath | 10 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org.eclipse.wst.common.component | 10 +- .../booking-portlet-faces/pom.xml | 2 +- .../booking-portlet-mvc/.classpath | 8 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- .../org.eclipse.wst.common.component | 8 +- .../booking-portlet-mvc/pom.xml | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 2 +- spring-webflow-samples/jsf-booking/pom.xml | 2 +- spring-webflow-samples/pom.xml | 2 +- spring-webflow/.classpath | 116 ++++++++++-------- spring-webflow/.project | 40 +++--- spring-webflow/ivy.xml | 2 +- spring-webflow/pom.xml | 14 ++- .../SecurityFlowExecutionListener.java | 15 +-- .../el/WebFlowELExpressionParserTests.java | 16 +-- .../SecurityFlowExecutionListenerTests.java | 18 +-- .../webflow/security/SecurityRuleTests.java | 2 +- 47 files changed, 466 insertions(+), 338 deletions(-) diff --git a/build.properties b/build.properties index 9dc4f45e..9c8b51c9 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,5 @@ -version=2.3.1 -release.type=release -build.stamp=RELEASE +version=2.3.2 +release.type=integration natural.name=spring-webflow project.key=SWF ivy.cache.dir=${basedir}/../ivy-cache diff --git a/pom.xml b/pom.xml index eb5841fa..b37353c3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ spring-webflow-root pom Spring Web Flow - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT spring-binding spring-js-resources diff --git a/spring-binding/.classpath b/spring-binding/.classpath index 0008c9c3..c0f54d82 100644 --- a/spring-binding/.classpath +++ b/spring-binding/.classpath @@ -1,19 +1,28 @@ + - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-binding/.project b/spring-binding/.project index bef675d6..a9a917b9 100644 --- a/spring-binding/.project +++ b/spring-binding/.project @@ -1,3 +1,4 @@ + spring-binding NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. @@ -6,8 +7,17 @@ org.eclipse.jdt.core.javabuilder + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature \ No newline at end of file diff --git a/spring-binding/pom.xml b/spring-binding/pom.xml index 336d657b..07e73cef 100644 --- a/spring-binding/pom.xml +++ b/spring-binding/pom.xml @@ -5,7 +5,7 @@ spring-binding jar Spring Binding - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT commons-logging @@ -82,6 +82,16 @@ maven2.java.net http://download.java.net/maven/2 + + jboss repository + https://repository.jboss.org/nexus/content/repositories/releases + + true + + + false + + diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java index 1ff18cfc..2bafa608 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/el/ELExpressionParserTests.java @@ -84,8 +84,8 @@ public class ELExpressionParserTests extends TestCase { public void testParseBeanEvalExpressionInvalidELVariable() { try { String expressionString = "bogus"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext() - .evaluate(TestBean.class)); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().evaluate(TestBean.class)); exp.getValue(new TestBean()); fail("Should have failed"); } catch (EvaluationException e) { @@ -108,8 +108,8 @@ public class ELExpressionParserTests extends TestCase { public void testParseTemplateExpressionWithVariables() { String expressionString = "#{value}#{max}"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext().template().variable( - new ExpressionVariable("max", "maximum"))); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().template().variable(new ExpressionVariable("max", "maximum"))); TestBean target = new TestBean(); assertEquals("foo2", exp.getValue(target)); } @@ -123,9 +123,11 @@ public class ELExpressionParserTests extends TestCase { public void testTemplateNestedVariables() { String expressionString = "#{value}#{max}"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext().template().variable( - new ExpressionVariable("max", "#{maximum}#{var}", new FluentParserContext().template().variable( - new ExpressionVariable("var", "'bar'"))))); + Expression exp = parser.parseExpression( + expressionString, + new FluentParserContext().template().variable( + new ExpressionVariable("max", "#{maximum}#{var}", new FluentParserContext().template() + .variable(new ExpressionVariable("var", "'bar'"))))); TestBean target = new TestBean(); assertEquals("foo2bar", exp.getValue(target)); } @@ -159,8 +161,8 @@ public class ELExpressionParserTests extends TestCase { public void testGetValueCoersionError() { String expressionString = "maximum"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext() - .expectResult(TestBean.class)); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().expectResult(TestBean.class)); TestBean context = new TestBean(); try { exp.getValue(context); diff --git a/spring-faces/.classpath b/spring-faces/.classpath index 280e5ecc..ce59bf97 100644 --- a/spring-faces/.classpath +++ b/spring-faces/.classpath @@ -1,37 +1,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-faces/.project b/spring-faces/.project index 674b52ad..c9a73088 100644 --- a/spring-faces/.project +++ b/spring-faces/.project @@ -1,17 +1,28 @@ - spring-faces - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + spring-faces + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + spring-binding + spring-js + spring-js-resources + spring-webflow + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + + \ No newline at end of file diff --git a/spring-faces/ivy.xml b/spring-faces/ivy.xml index 0a4d0ab9..ce6036ab 100644 --- a/spring-faces/ivy.xml +++ b/spring-faces/ivy.xml @@ -39,8 +39,8 @@ - - + + diff --git a/spring-faces/pom.xml b/spring-faces/pom.xml index 364d7983..faabcf97 100644 --- a/spring-faces/pom.xml +++ b/spring-faces/pom.xml @@ -5,7 +5,7 @@ spring-faces jar Spring Faces - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT commons-logging @@ -66,13 +66,13 @@ org.springframework.security spring-security-core - 3.0.2.RELEASE + 3.1.3.RELEASE true org.springframework.security spring-security-web - 3.0.2.RELEASE + 3.1.3.RELEASE true @@ -155,6 +155,18 @@ test + + + jboss repository + https://repository.jboss.org/nexus/content/repositories/releases + + true + + + false + + + diff --git a/spring-faces/src/main/java/org/springframework/faces/security/AbstractAuthorizeTag.java b/spring-faces/src/main/java/org/springframework/faces/security/AbstractAuthorizeTag.java index d427563b..26c1c27c 100644 --- a/spring-faces/src/main/java/org/springframework/faces/security/AbstractAuthorizeTag.java +++ b/spring-faces/src/main/java/org/springframework/faces/security/AbstractAuthorizeTag.java @@ -134,7 +134,7 @@ public abstract class AbstractAuthorizeTag { return false; } - final Collection granted = getPrincipalAuthorities(); + final Collection granted = getPrincipalAuthorities(); if (hasTextAllGranted) { if (!granted.containsAll(parseAuthoritiesString(getIfAllGranted()))) { @@ -143,14 +143,14 @@ public abstract class AbstractAuthorizeTag { } if (hasTextAnyGranted) { - Set grantedCopy = retainAll(granted, parseAuthoritiesString(getIfAnyGranted())); + Set grantedCopy = retainAll(granted, parseAuthoritiesString(getIfAnyGranted())); if (grantedCopy.isEmpty()) { return false; } } if (hasTextNotGranted) { - Set grantedCopy = retainAll(granted, parseAuthoritiesString(getIfNotGranted())); + Set grantedCopy = retainAll(granted, parseAuthoritiesString(getIfNotGranted())); if (!grantedCopy.isEmpty()) { return false; } @@ -258,7 +258,7 @@ public abstract class AbstractAuthorizeTag { /*------------- Private helper methods -----------------*/ - private Collection getPrincipalAuthorities() { + private Collection getPrincipalAuthorities() { Authentication currentUser = SecurityContextHolder.getContext().getAuthentication(); if (null == currentUser) { return Collections.emptyList(); @@ -272,7 +272,7 @@ public abstract class AbstractAuthorizeTag { return requiredAuthorities; } - private Set retainAll(final Collection granted, + private Set retainAll(final Collection granted, final Set required) { Set grantedRoles = authoritiesToRoles(granted); Set requiredRoles = authoritiesToRoles(required); @@ -281,7 +281,7 @@ public abstract class AbstractAuthorizeTag { return rolesToAuthorities(grantedRoles, granted); } - private Set authoritiesToRoles(Collection c) { + private Set authoritiesToRoles(Collection c) { Set target = new HashSet(); for (GrantedAuthority authority : c) { if (null == authority.getAuthority()) { @@ -294,7 +294,8 @@ public abstract class AbstractAuthorizeTag { return target; } - private Set rolesToAuthorities(Set grantedRoles, Collection granted) { + private Set rolesToAuthorities(Set grantedRoles, + Collection granted) { Set target = new HashSet(); for (String role : grantedRoles) { for (GrantedAuthority authority : granted) { diff --git a/spring-js-resources/.classpath b/spring-js-resources/.classpath index ad246cf5..05399527 100644 --- a/spring-js-resources/.classpath +++ b/spring-js-resources/.classpath @@ -1,9 +1,9 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/spring-js-resources/.project b/spring-js-resources/.project index 94561936..cef8ce87 100644 --- a/spring-js-resources/.project +++ b/spring-js-resources/.project @@ -1,17 +1,23 @@ - spring-js-resources - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + spring-js-resources + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + + \ No newline at end of file diff --git a/spring-js-resources/.settings/org.eclipse.jdt.core.prefs b/spring-js-resources/.settings/org.eclipse.jdt.core.prefs index 2fdeadfc..473ff55e 100644 --- a/spring-js-resources/.settings/org.eclipse.jdt.core.prefs +++ b/spring-js-resources/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,3 @@ -#Wed Jun 09 09:15:58 BST 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.codeComplete.argumentPrefixes= org.eclipse.jdt.core.codeComplete.argumentSuffixes= @@ -151,7 +150,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=8 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert diff --git a/spring-js-resources/pom.xml b/spring-js-resources/pom.xml index 9353abc0..57d7b82f 100644 --- a/spring-js-resources/pom.xml +++ b/spring-js-resources/pom.xml @@ -5,7 +5,7 @@ spring-js-resources jar Spring JavaScript Resources - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT diff --git a/spring-js/.classpath b/spring-js/.classpath index 8f562ac0..a30f30be 100644 --- a/spring-js/.classpath +++ b/spring-js/.classpath @@ -1,29 +1,38 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-js/.project b/spring-js/.project index 335ed577..b470d90f 100644 --- a/spring-js/.project +++ b/spring-js/.project @@ -1,17 +1,25 @@ - spring-js - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + spring-js + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + spring-js-resources + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + + \ No newline at end of file diff --git a/spring-js/pom.xml b/spring-js/pom.xml index a73d02d4..9378298e 100644 --- a/spring-js/pom.xml +++ b/spring-js/pom.xml @@ -5,7 +5,7 @@ spring-js jar Spring JavaScript - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT commons-logging diff --git a/spring-webflow-samples/booking-faces/.classpath b/spring-webflow-samples/booking-faces/.classpath index 9d5eb34b..21ae14d1 100644 --- a/spring-webflow-samples/booking-faces/.classpath +++ b/spring-webflow-samples/booking-faces/.classpath @@ -17,8 +17,6 @@ - - @@ -47,22 +45,22 @@ - + - + - - + + - - - + + + - + diff --git a/spring-webflow-samples/booking-faces/.settings/org.eclipse.jdt.core.prefs b/spring-webflow-samples/booking-faces/.settings/org.eclipse.jdt.core.prefs index 52bc3d9a..3de8692f 100644 --- a/spring-webflow-samples/booking-faces/.settings/org.eclipse.jdt.core.prefs +++ b/spring-webflow-samples/booking-faces/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Dec 21 11:54:49 EST 2012 +#Fri Dec 21 14:08:24 EST 2012 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 diff --git a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component index 5d52a941..cea44692 100644 --- a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component @@ -15,12 +15,6 @@ uses - - uses - - - uses - uses @@ -93,7 +87,7 @@ uses - + uses @@ -105,28 +99,28 @@ uses - + uses uses - + uses - + uses uses - + uses - + uses - + uses @@ -135,7 +129,7 @@ uses - + uses diff --git a/spring-webflow-samples/booking-faces/pom.xml b/spring-webflow-samples/booking-faces/pom.xml index d24d33b0..c075635e 100644 --- a/spring-webflow-samples/booking-faces/pom.xml +++ b/spring-webflow-samples/booking-faces/pom.xml @@ -6,10 +6,10 @@ booking-faces war Hotel Booking : Spring MVC + Web Flow + JSF/PrimeFaces - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT 3.2.0.RELEASE - 3.0.2.RELEASE + 3.1.3.RELEASE 1.5.10 2.1.7 3.1.1 @@ -43,6 +43,11 @@ spring-webmvc ${org.springframework-version} + + org.springframework.webflow + spring-webflow + ${project.version} + org.springframework.webflow spring-faces diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml index ef58ed92..09e44dc9 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> diff --git a/spring-webflow-samples/booking-mvc/.classpath b/spring-webflow-samples/booking-mvc/.classpath index f8e5f9f9..9250d992 100644 --- a/spring-webflow-samples/booking-mvc/.classpath +++ b/spring-webflow-samples/booking-mvc/.classpath @@ -19,8 +19,6 @@ - - @@ -53,24 +51,23 @@ - + - - - + + - - - - - + + + + + - + diff --git a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.jdt.core.prefs b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.jdt.core.prefs index 52bc3d9a..0092150d 100644 --- a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.jdt.core.prefs +++ b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Dec 21 11:54:49 EST 2012 +#Fri Dec 21 14:08:22 EST 2012 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 diff --git a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component index f5e3879d..57d4c8e4 100644 --- a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component @@ -15,12 +15,6 @@ uses - - uses - - - uses - uses @@ -96,15 +90,12 @@ uses - + uses uses - - uses - uses @@ -114,28 +105,28 @@ uses - + uses - + uses uses - + uses - + uses - + uses - + uses - + uses @@ -144,7 +135,7 @@ uses - + uses diff --git a/spring-webflow-samples/booking-mvc/pom.xml b/spring-webflow-samples/booking-mvc/pom.xml index 26c3391d..d5829eb6 100644 --- a/spring-webflow-samples/booking-mvc/pom.xml +++ b/spring-webflow-samples/booking-mvc/pom.xml @@ -6,14 +6,26 @@ booking-mvc war Hotel Booking : Spring MVC + Web Flow + JSP - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT 3.2.0.RELEASE - 3.0.2.RELEASE + 3.1.3.RELEASE 1.5.10 + + org.springframework + spring-context + ${org.springframework-version} + + + + commons-logging + commons-logging + + + org.springframework spring-webmvc @@ -55,7 +67,7 @@ commons-logging commons-logging - + @@ -72,7 +84,7 @@ commons-logging commons-logging - + diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml index 9a5df657..c1a44fca 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd - http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> diff --git a/spring-webflow-samples/booking-portlet-faces/.classpath b/spring-webflow-samples/booking-portlet-faces/.classpath index fdcb4123..3bfe0dc6 100644 --- a/spring-webflow-samples/booking-portlet-faces/.classpath +++ b/spring-webflow-samples/booking-portlet-faces/.classpath @@ -50,19 +50,19 @@ - + - + - - + + - + diff --git a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.jdt.core.prefs b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.jdt.core.prefs index 52bc3d9a..3de8692f 100644 --- a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.jdt.core.prefs +++ b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Dec 21 11:54:49 EST 2012 +#Fri Dec 21 14:08:24 EST 2012 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 diff --git a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component index 4589450a..7b6c0c0d 100644 --- a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component @@ -99,7 +99,7 @@ uses - + uses @@ -111,16 +111,16 @@ uses - + uses uses - + uses - + uses @@ -132,7 +132,7 @@ uses - + uses diff --git a/spring-webflow-samples/booking-portlet-faces/pom.xml b/spring-webflow-samples/booking-portlet-faces/pom.xml index 63cec464..b33c798c 100644 --- a/spring-webflow-samples/booking-portlet-faces/pom.xml +++ b/spring-webflow-samples/booking-portlet-faces/pom.xml @@ -6,7 +6,7 @@ booking-portlet-faces war Hotel Booking : Spring Portlet MVC + Web Flow + JSF - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT 3.2.0.RELEASE 1.5.10 diff --git a/spring-webflow-samples/booking-portlet-mvc/.classpath b/spring-webflow-samples/booking-portlet-mvc/.classpath index 5c8526c5..a4a69799 100644 --- a/spring-webflow-samples/booking-portlet-mvc/.classpath +++ b/spring-webflow-samples/booking-portlet-mvc/.classpath @@ -45,18 +45,18 @@ - + - - + + - + diff --git a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.jdt.core.prefs b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.jdt.core.prefs index 52bc3d9a..3de8692f 100644 --- a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.jdt.core.prefs +++ b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Dec 21 11:54:49 EST 2012 +#Fri Dec 21 14:08:24 EST 2012 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 diff --git a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component index 96fb36b6..8cbea9f2 100644 --- a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component @@ -84,7 +84,7 @@ uses - + uses @@ -99,10 +99,10 @@ uses - + uses - + uses @@ -114,7 +114,7 @@ uses - + uses diff --git a/spring-webflow-samples/booking-portlet-mvc/pom.xml b/spring-webflow-samples/booking-portlet-mvc/pom.xml index 56e2a811..208ce3de 100644 --- a/spring-webflow-samples/booking-portlet-mvc/pom.xml +++ b/spring-webflow-samples/booking-portlet-mvc/pom.xml @@ -6,7 +6,7 @@ booking-portlet-mvc war Hotel Booking : Spring Portlet MVC + Web Flow + JSP - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT 3.2.0.RELEASE 1.5.10 diff --git a/spring-webflow-samples/jsf-booking/.settings/org.eclipse.jdt.core.prefs b/spring-webflow-samples/jsf-booking/.settings/org.eclipse.jdt.core.prefs index 52bc3d9a..3de8692f 100644 --- a/spring-webflow-samples/jsf-booking/.settings/org.eclipse.jdt.core.prefs +++ b/spring-webflow-samples/jsf-booking/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Fri Dec 21 11:54:49 EST 2012 +#Fri Dec 21 14:08:24 EST 2012 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 diff --git a/spring-webflow-samples/jsf-booking/pom.xml b/spring-webflow-samples/jsf-booking/pom.xml index d00c0b41..66aeaf43 100644 --- a/spring-webflow-samples/jsf-booking/pom.xml +++ b/spring-webflow-samples/jsf-booking/pom.xml @@ -6,7 +6,7 @@ jsf-booking war Hotel Booking : Spring Framework + JSF - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT 3.2.0.RELEASE 1.5.10 diff --git a/spring-webflow-samples/pom.xml b/spring-webflow-samples/pom.xml index c03f56c3..ecb02cd8 100644 --- a/spring-webflow-samples/pom.xml +++ b/spring-webflow-samples/pom.xml @@ -6,7 +6,7 @@ spring-webflow-samples pom Spring Web Flow Samples - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT booking-mvc booking-faces diff --git a/spring-webflow/.classpath b/spring-webflow/.classpath index ff4e0ebe..9fa592da 100644 --- a/spring-webflow/.classpath +++ b/spring-webflow/.classpath @@ -1,51 +1,69 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-webflow/.project b/spring-webflow/.project index 3701fb0a..13584d89 100644 --- a/spring-webflow/.project +++ b/spring-webflow/.project @@ -1,17 +1,27 @@ - spring-webflow - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + spring-webflow + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + spring-binding + spring-js + spring-js-resources + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + + \ No newline at end of file diff --git a/spring-webflow/ivy.xml b/spring-webflow/ivy.xml index 97955b5c..7ad6547c 100644 --- a/spring-webflow/ivy.xml +++ b/spring-webflow/ivy.xml @@ -39,7 +39,7 @@ - + diff --git a/spring-webflow/pom.xml b/spring-webflow/pom.xml index a603ddd4..f47ea8a4 100644 --- a/spring-webflow/pom.xml +++ b/spring-webflow/pom.xml @@ -5,7 +5,7 @@ spring-webflow jar Spring Web Flow - 2.3.1.RELEASE + 2.3.2.BUILD-SNAPSHOT commons-logging @@ -121,7 +121,7 @@ org.springframework.security spring-security-core - 3.0.2.RELEASE + 3.1.3.RELEASE true @@ -192,6 +192,16 @@ maven2.java.net http://download.java.net/maven/2 + + jboss repository + https://repository.jboss.org/nexus/content/repositories/releases + + true + + + false + + diff --git a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java index 9bc220fa..c48896fa 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/security/SecurityFlowExecutionListener.java @@ -21,6 +21,8 @@ import java.util.Iterator; import java.util.List; import org.springframework.security.access.AccessDecisionManager; +import org.springframework.security.access.AccessDecisionVoter; +import org.springframework.security.access.ConfigAttribute; import org.springframework.security.access.SecurityConfig; import org.springframework.security.access.vote.AbstractAccessDecisionManager; import org.springframework.security.access.vote.AffirmativeBased; @@ -90,21 +92,20 @@ public class SecurityFlowExecutionListener extends FlowExecutionListenerAdapter */ protected void decide(SecurityRule rule, Object object) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); - Collection configAttributes = getConfigAttributes(rule); + Collection configAttributes = getConfigAttributes(rule); if (accessDecisionManager != null) { accessDecisionManager.decide(authentication, object, configAttributes); } else { AbstractAccessDecisionManager abstractAccessDecisionManager; - List voters = new ArrayList(); + List voters = new ArrayList(); voters.add(new RoleVoter()); if (rule.getComparisonType() == SecurityRule.COMPARISON_ANY) { - abstractAccessDecisionManager = new AffirmativeBased(); + abstractAccessDecisionManager = new AffirmativeBased(voters); } else if (rule.getComparisonType() == SecurityRule.COMPARISON_ALL) { - abstractAccessDecisionManager = new UnanimousBased(); + abstractAccessDecisionManager = new UnanimousBased(voters); } else { throw new IllegalStateException("Unknown SecurityRule match type: " + rule.getComparisonType()); } - abstractAccessDecisionManager.setDecisionVoters(voters); abstractAccessDecisionManager.decide(authentication, object, configAttributes); } } @@ -114,8 +115,8 @@ public class SecurityFlowExecutionListener extends FlowExecutionListenerAdapter * @param rule the rule to convert * @return list of ConfigAttributes for Spring Security */ - protected Collection getConfigAttributes(SecurityRule rule) { - List configAttributes = new ArrayList(); + protected Collection getConfigAttributes(SecurityRule rule) { + List configAttributes = new ArrayList(); Iterator attributeIt = rule.getAttributes().iterator(); while (attributeIt.hasNext()) { configAttributes.add(new SecurityConfig((String) attributeIt.next())); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java index f943c0eb..22e366d8 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/expression/el/WebFlowELExpressionParserTests.java @@ -49,8 +49,8 @@ public class WebFlowELExpressionParserTests extends TestCase { public void testResolveFlowRequestContext() { MockRequestContext context = new MockRequestContext(); - Expression exp = parser.parseExpression("flowRequestContext", new FluentParserContext() - .evaluate(RequestContext.class)); + Expression exp = parser.parseExpression("flowRequestContext", + new FluentParserContext().evaluate(RequestContext.class)); assertSame(context, exp.getValue(context)); } @@ -164,8 +164,8 @@ public class WebFlowELExpressionParserTests extends TestCase { StaticApplicationContext ac = new StaticApplicationContext(); ac.getBeanFactory().registerSingleton("multiAction", new FormAction()); context.getRootFlow().setApplicationContext(ac); - Expression exp = parser.parseExpression("multiAction.setupForm", new FluentParserContext() - .evaluate(RequestContext.class)); + Expression exp = parser.parseExpression("multiAction.setupForm", + new FluentParserContext().evaluate(RequestContext.class)); AnnotatedAction action = (AnnotatedAction) exp.getValue(context); assertSame(ac.getBean("multiAction"), action.getTargetAction()); assertEquals("setupForm", action.getMethod()); @@ -176,8 +176,8 @@ public class WebFlowELExpressionParserTests extends TestCase { LocalAttributeMap attributes = new LocalAttributeMap(); attributes.put("foo", "bar"); context.setCurrentEvent(new Event(this, "event", attributes)); - Expression exp = parser.parseExpression("currentEvent.attributes.foo", new FluentParserContext() - .evaluate(RequestContext.class)); + Expression exp = parser.parseExpression("currentEvent.attributes.foo", + new FluentParserContext().evaluate(RequestContext.class)); assertEquals("bar", exp.getValue(context)); } @@ -194,8 +194,8 @@ public class WebFlowELExpressionParserTests extends TestCase { ac.refresh(); context.getRootFlow().setApplicationContext(ac); context.getMockExternalContext().setLocale(Locale.FRANCE); - Expression exp = parser.parseExpression("resourceBundle.foo", new FluentParserContext() - .evaluate(RequestContext.class)); + Expression exp = parser.parseExpression("resourceBundle.foo", + new FluentParserContext().evaluate(RequestContext.class)); assertEquals("bar", exp.getValue(context)); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java index 1a41df97..d9813794 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityFlowExecutionListenerTests.java @@ -1,7 +1,9 @@ package org.springframework.webflow.security; +import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; +import java.util.List; import junit.framework.TestCase; @@ -9,7 +11,7 @@ import org.springframework.security.access.AccessDeniedException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.GrantedAuthorityImpl; +import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContext; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextImpl; @@ -117,7 +119,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAnyAuthorized() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ANY); - Collection attributes = new HashSet(); + Collection attributes = new HashSet(); attributes.add("ROLE_1"); attributes.add("ROLE_A"); rule.setAttributes(attributes); @@ -127,7 +129,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAnyDenied() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ANY); - Collection attributes = new HashSet(); + Collection attributes = new HashSet(); attributes.add("ROLE_A"); attributes.add("ROLE_B"); rule.setAttributes(attributes); @@ -137,7 +139,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAllAuthorized() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ALL); - Collection attributes = new HashSet(); + Collection attributes = new HashSet(); attributes.add("ROLE_1"); attributes.add("ROLE_3"); rule.setAttributes(attributes); @@ -147,7 +149,7 @@ public class SecurityFlowExecutionListenerTests extends TestCase { private SecurityRule getSecurityRuleAllDenied() { SecurityRule rule = new SecurityRule(); rule.setComparisonType(SecurityRule.COMPARISON_ALL); - Collection attributes = new HashSet(); + Collection attributes = new HashSet(); attributes.add("ROLE_1"); attributes.add("ROLE_A"); rule.setAttributes(attributes); @@ -155,8 +157,10 @@ public class SecurityFlowExecutionListenerTests extends TestCase { } private Authentication getAuthentication() { - GrantedAuthority[] authorities = { new GrantedAuthorityImpl("ROLE_1"), new GrantedAuthorityImpl("ROLE_2"), - new GrantedAuthorityImpl("ROLE_3") }; + List authorities = new ArrayList(); + authorities.add(new SimpleGrantedAuthority("ROLE_1")); + authorities.add(new SimpleGrantedAuthority("ROLE_2")); + authorities.add(new SimpleGrantedAuthority("ROLE_3")); return new UsernamePasswordAuthenticationToken("test", "", authorities); } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java index ac89ecb3..2c2dc853 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/security/SecurityRuleTests.java @@ -9,7 +9,7 @@ import junit.framework.TestCase; public class SecurityRuleTests extends TestCase { public void testConvertAttributesToCommaSeparatedString() { - Collection attributes = new ArrayList(); + Collection attributes = new ArrayList(); attributes.add("ROLE_1"); attributes.add("ROLE_2"); Assert.assertEquals("ROLE_1, ROLE_2", SecurityRule.securityAttributesToCommaDelimitedList(attributes));