From a25e4a860c6fdd86aa991da0e48b3462b6f98531 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 15 Oct 2018 12:02:16 +0100 Subject: [PATCH 1/2] Upgrade to Thymeleaf Extras Spring Security 3.0.3.RELEASE Closes gh-14829 --- spring-boot-project/spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index c578b32dc4f..c9e5be8040f 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -172,7 +172,7 @@ 3.1.0 ${javax-mail.version} 3.0.10.RELEASE - 3.0.2.RELEASE + 3.0.3.RELEASE 2.3.0 2.0.1 3.0.1.RELEASE From ab7c1af3ec9977bbaad2e257bc7b0778c7252599 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 15 Oct 2018 12:18:40 +0100 Subject: [PATCH 2/2] Auto-configure SpringSecurityDialect for v5 and deprecate v4 Closes gh-14828 --- .../spring-boot-autoconfigure/pom.xml | 5 +++++ .../thymeleaf/ThymeleafAutoConfiguration.java | 20 +++++++++++++++++++ .../spring-boot-dependencies/pom.xml | 9 ++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/pom.xml b/spring-boot-project/spring-boot-autoconfigure/pom.xml index 1fe5e133374..901d53cbe10 100755 --- a/spring-boot-project/spring-boot-autoconfigure/pom.xml +++ b/spring-boot-project/spring-boot-autoconfigure/pom.xml @@ -623,6 +623,11 @@ thymeleaf-extras-springsecurity4 true + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + true + javax.jms javax.jms-api diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java index 7475e0f45d1..a0635401db3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java @@ -327,14 +327,34 @@ public class ThymeleafAutoConfiguration { @ConditionalOnClass({ SpringSecurityDialect.class }) protected static class ThymeleafSecurityDialectConfiguration { + private final Log logger = LogFactory + .getLog(ThymeleafSecurityDialectConfiguration.class); + @Bean @ConditionalOnMissingBean public SpringSecurityDialect securityDialect() { + if (this.logger.isWarnEnabled()) { + this.logger.warn("Auto-configuration for thymeleaf-extras-springsecurity4" + + " is deprecated in favour of thymeleaf-extras-springsecurity5"); + } return new SpringSecurityDialect(); } } + @Configuration + @ConditionalOnClass({ + org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect.class }) + protected static class ThymeleafSecurity5DialectConfiguration { + + @Bean + @ConditionalOnMissingBean + public org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect securityDialect() { + return new org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect(); + } + + } + @Configuration @ConditionalOnClass(Java8TimeDialect.class) protected static class ThymeleafJava8TimeDialect { diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index c9e5be8040f..7cd06f2a3a2 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -172,7 +172,9 @@ 3.1.0 ${javax-mail.version} 3.0.10.RELEASE + 3.0.3.RELEASE + ${thymeleaf-extras-springsecurity4.version} 2.3.0 2.0.1 3.0.1.RELEASE @@ -2951,7 +2953,12 @@ org.thymeleaf.extras thymeleaf-extras-springsecurity4 - ${thymeleaf-extras-springsecurity4.version} + ${thymeleaf-extras-springsecurity.version} + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity5 + ${thymeleaf-extras-springsecurity.version} org.webjars