From a2258914567b31b5783fd60af5e88adcfa0ae55d Mon Sep 17 00:00:00 2001 From: DOHA Date: Tue, 5 Jan 2016 19:55:11 +0200 Subject: [PATCH] cleanup and upgrade --- spring-all/pom.xml | 4 -- spring-katharsis/pom.xml | 6 ++- spring-security-mvc-ldap/pom.xml | 42 ++----------------- .../org/baeldung/security/SecurityConfig.java | 4 +- .../src/main/resources/templates/login.html | 2 +- .../src/main/resources/webSecurityConfig.xml | 5 +-- spring-security-rest-full/pom.xml | 26 ++++++------ spring-security-rest/pom.xml | 18 ++++---- .../baeldung/spring/SecurityJavaConfig.java | 7 +--- .../src/main/resources/webSecurityConfig.xml | 4 +- 10 files changed, 42 insertions(+), 76 deletions(-) diff --git a/spring-all/pom.xml b/spring-all/pom.xml index 16ff340d81..6ce8ad7196 100644 --- a/spring-all/pom.xml +++ b/spring-all/pom.xml @@ -128,7 +128,6 @@ junit junit - ${junit.version} test @@ -164,7 +163,6 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler-plugin.version} 1.8 1.8 @@ -174,7 +172,6 @@ org.apache.maven.plugins maven-war-plugin - ${maven-war-plugin.version} false @@ -183,7 +180,6 @@ org.apache.maven.plugins maven-surefire-plugin - ${maven-surefire-plugin.version} diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 554ff4e656..892aaf24f1 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -31,7 +31,7 @@ io.katharsis katharsis-servlet - 1.0.0 + ${katharsis.version} @@ -45,7 +45,7 @@ com.jayway.restassured rest-assured - 2.4.0 + ${restassured.version} test @@ -60,6 +60,8 @@ 1.8 + 1.0.0 + 2.4.0 diff --git a/spring-security-mvc-ldap/pom.xml b/spring-security-mvc-ldap/pom.xml index 5282f76a7e..3f9b9ad1ed 100644 --- a/spring-security-mvc-ldap/pom.xml +++ b/spring-security-mvc-ldap/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 1.2.4.RELEASE + 1.3.1.RELEASE @@ -39,7 +39,7 @@ org.apache.directory.server apacheds-server-jndi - 1.5.5 + ${apacheds.version} @@ -68,42 +68,8 @@ - - - 4.2.4.RELEASE - 4.0.3.RELEASE - - - 4.3.11.Final - 5.1.37 - - - 1.7.13 - 1.1.3 - - - 5.2.2.Final - - - 19.0 - 3.4 - - - 1.3 - 4.12 - 1.10.19 - - 4.4.1 - 4.5 - - 2.4.1 - - - 3.3 - 2.6 - 2.18.1 - 1.4.15 - + + 1.5.5 diff --git a/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java b/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java index ee72ee7891..0d444e36ff 100644 --- a/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java +++ b/spring-security-mvc-ldap/src/main/java/org/baeldung/security/SecurityConfig.java @@ -9,7 +9,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur * Security Configuration - LDAP and HTTP Authorizations. */ @Configuration -// @ImportResource({ "classpath:webSecurityConfig.xml" }) +// @ImportResource({ "classpath:webSecurityConfig.xml" }) //=> uncomment to use equivalent xml config public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override @@ -20,7 +20,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers("/", "/home").permitAll().anyRequest().authenticated(); - http.formLogin().loginPage("/login").permitAll().loginProcessingUrl("/j_spring_security_check").and().logout().logoutSuccessUrl("/"); + http.formLogin().loginPage("/login").permitAll().and().logout().logoutSuccessUrl("/"); } } diff --git a/spring-security-mvc-ldap/src/main/resources/templates/login.html b/spring-security-mvc-ldap/src/main/resources/templates/login.html index 81f62fde13..e21ea21e69 100644 --- a/spring-security-mvc-ldap/src/main/resources/templates/login.html +++ b/spring-security-mvc-ldap/src/main/resources/templates/login.html @@ -21,7 +21,7 @@

You have been logged out

There was an error, please try again

Login with Username and Password

-
+
diff --git a/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml b/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml index 6bd2c422d8..c13f65de5e 100644 --- a/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml +++ b/spring-security-mvc-ldap/src/main/resources/webSecurityConfig.xml @@ -13,10 +13,7 @@ - + diff --git a/spring-security-rest-full/pom.xml b/spring-security-rest-full/pom.xml index bed716897b..cbcc3fca64 100644 --- a/spring-security-rest-full/pom.xml +++ b/spring-security-rest-full/pom.xml @@ -10,7 +10,7 @@ org.springframework.boot spring-boot-starter-parent - 1.3.0.RELEASE + 1.3.1.RELEASE @@ -113,12 +113,12 @@ com.mysema.querydsl querydsl-apt - 3.6.2 + ${querydsl.version} com.mysema.querydsl querydsl-jpa - 3.6.2 + ${querydsl.version} @@ -126,7 +126,7 @@ cz.jirutka.rsql rsql-parser - 2.0.0 + ${rsql.version} @@ -144,7 +144,6 @@ org.apache.httpcomponents httpcore - ${httpcore.version} @@ -164,7 +163,7 @@ xml-apis xml-apis - 1.4.01 + ${xml-apis.version} org.javassist @@ -200,7 +199,7 @@ com.thoughtworks.xstream xstream - 1.4.8 + ${xstream.version} @@ -243,7 +242,6 @@ junit junit - ${junit.version} test @@ -267,7 +265,7 @@ com.jayway.restassured rest-assured - 2.4.0 + ${rest-assured.version} test @@ -344,7 +342,7 @@ com.mysema.maven apt-maven-plugin - 1.1.3 + ${apt-maven-plugin.version} @@ -434,9 +432,12 @@ 5.1.37 1.7.2.RELEASE + 2.0.0 + 3.6.2 + - 2.5.5 + 1.4.01 1.7.13 @@ -444,6 +445,7 @@ 5.2.2.Final + 1.4.8 19.0 @@ -464,7 +466,7 @@ 2.6 2.18.1 1.4.15 - + 1.1.3 \ No newline at end of file diff --git a/spring-security-rest/pom.xml b/spring-security-rest/pom.xml index 42381bf607..2046b38810 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-rest/pom.xml @@ -82,14 +82,14 @@ javax.servlet javax.servlet-api - 3.0.1 + ${javax.servlet-api.version} provided javax.servlet jstl - 1.2 + ${jstl.version} runtime @@ -98,7 +98,7 @@ com.fasterxml.jackson.core jackson-databind - 2.2.2 + ${jackson.version} @@ -111,7 +111,7 @@ org.apache.commons commons-lang3 - 3.1 + ${commons-lang3.version} @@ -171,13 +171,13 @@ io.springfox springfox-swagger2 - 2.2.2 + ${springfox.version} io.springfox springfox-swagger-ui - 2.2.2 + ${springfox.version} @@ -263,7 +263,11 @@ 5.2.2.Final - + 3.0.1 + 1.2 + 2.2.2 + 2.2.2 + 19.0 3.4 diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java index ca882909f0..5b88fefdb2 100644 --- a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java +++ b/spring-security-rest/src/main/java/org/baeldung/spring/SecurityJavaConfig.java @@ -35,19 +35,16 @@ public class SecurityJavaConfig extends WebSecurityConfigurerAdapter { } @Override - protected void configure(final HttpSecurity http) throws Exception { // @formatter:off + protected void configure(final HttpSecurity http) throws Exception {// @formatter:off http .csrf().disable() .exceptionHandling() .authenticationEntryPoint(restAuthenticationEntryPoint) .and() .authorizeRequests() - .antMatchers("/api/foos").authenticated() + .antMatchers("/api/**").authenticated() .and() .formLogin() - .loginProcessingUrl("/j_spring_security_check") - .usernameParameter("j_username") - .passwordParameter("j_password") .successHandler(authenticationSuccessHandler) .failureHandler(new SimpleUrlAuthenticationFailureHandler()) .and() diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-rest/src/main/resources/webSecurityConfig.xml index 20651c458c..619b53fb7e 100644 --- a/spring-security-rest/src/main/resources/webSecurityConfig.xml +++ b/spring-security-rest/src/main/resources/webSecurityConfig.xml @@ -11,7 +11,9 @@ - + + +