diff --git a/mujina-common/src/main/java/mujina/api/ErrorController.java b/mujina-common/src/main/java/mujina/api/ErrorController.java index d4d7abc7..93971fc9 100644 --- a/mujina-common/src/main/java/mujina/api/ErrorController.java +++ b/mujina-common/src/main/java/mujina/api/ErrorController.java @@ -1,19 +1,18 @@ package mujina.api; -import org.springframework.boot.autoconfigure.web.ErrorAttributes; +import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.context.request.RequestAttributes; -import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.context.request.ServletWebRequest; import javax.servlet.http.HttpServletRequest; import java.util.Map; import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; -public class ErrorController implements org.springframework.boot.autoconfigure.web.ErrorController { +public class ErrorController implements org.springframework.boot.web.servlet.error.ErrorController { private final ErrorAttributes errorAttributes; @@ -29,8 +28,8 @@ public String getErrorPath() { @RequestMapping public ResponseEntity> error(HttpServletRequest aRequest) { - RequestAttributes requestAttributes = new ServletRequestAttributes(aRequest); - Map result = this.errorAttributes.getErrorAttributes(requestAttributes, false); + ServletWebRequest webRequest = new ServletWebRequest(aRequest); + Map result = this.errorAttributes.getErrorAttributes(webRequest, false); HttpStatus statusCode = INTERNAL_SERVER_ERROR; Object status = result.get("status"); diff --git a/mujina-idp/pom.xml b/mujina-idp/pom.xml index 730cad03..9e0ad0f8 100644 --- a/mujina-idp/pom.xml +++ b/mujina-idp/pom.xml @@ -63,12 +63,10 @@ org.apache.commons commons-lang3 - 3.5 io.rest-assured rest-assured - 3.0.2 test diff --git a/mujina-idp/src/main/java/mujina/MujinaIdpApplication.java b/mujina-idp/src/main/java/mujina/MujinaIdpApplication.java index 6369428f..1745ef2e 100644 --- a/mujina-idp/src/main/java/mujina/MujinaIdpApplication.java +++ b/mujina-idp/src/main/java/mujina/MujinaIdpApplication.java @@ -1,14 +1,9 @@ package mujina; import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.TraceWebFilterAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -@SpringBootApplication(exclude = { - TraceWebFilterAutoConfiguration.class, - MetricFilterAutoConfiguration.class -}) +@SpringBootApplication() public class MujinaIdpApplication { public static void main(String[] args) { diff --git a/mujina-idp/src/main/java/mujina/api/IdpErrorController.java b/mujina-idp/src/main/java/mujina/api/IdpErrorController.java index a4b4affb..a13dc61b 100644 --- a/mujina-idp/src/main/java/mujina/api/IdpErrorController.java +++ b/mujina-idp/src/main/java/mujina/api/IdpErrorController.java @@ -1,7 +1,7 @@ package mujina.api; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ErrorAttributes; +import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/mujina-idp/src/main/java/mujina/idp/WebSecurityConfigurer.java b/mujina-idp/src/main/java/mujina/idp/WebSecurityConfigurer.java index ed164d08..12f3e359 100644 --- a/mujina-idp/src/main/java/mujina/idp/WebSecurityConfigurer.java +++ b/mujina-idp/src/main/java/mujina/idp/WebSecurityConfigurer.java @@ -14,12 +14,9 @@ import org.opensaml.xml.parse.XMLParserException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.security.SecurityProperties; import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; -import org.springframework.core.env.Environment; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; @@ -30,7 +27,7 @@ import org.springframework.security.saml.util.VelocityFactory; import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import javax.xml.stream.XMLStreamException; import java.io.IOException; @@ -45,10 +42,7 @@ @Configuration @EnableWebSecurity -public class WebSecurityConfigurer extends WebMvcConfigurerAdapter { - - @Autowired - private Environment environment; +public class WebSecurityConfigurer implements WebMvcConfigurer { @Bean @Autowired @@ -106,7 +100,6 @@ public ServletContextInitializer servletContextInitializer() { } @Configuration - @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) protected static class ApplicationSecurity extends WebSecurityConfigurerAdapter { @Autowired diff --git a/mujina-idp/src/test/java/mujina/AbstractIntegrationTest.java b/mujina-idp/src/test/java/mujina/AbstractIntegrationTest.java index b7fe292c..b5aec153 100644 --- a/mujina-idp/src/test/java/mujina/AbstractIntegrationTest.java +++ b/mujina-idp/src/test/java/mujina/AbstractIntegrationTest.java @@ -6,8 +6,8 @@ import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.embedded.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.context.junit4.SpringRunner; import static io.restassured.RestAssured.given; diff --git a/mujina-sp/pom.xml b/mujina-sp/pom.xml index 872b2fff..acaaf488 100644 --- a/mujina-sp/pom.xml +++ b/mujina-sp/pom.xml @@ -64,7 +64,6 @@ org.apache.commons commons-lang3 - 3.5 com.github.tomakehurst @@ -75,7 +74,6 @@ io.rest-assured rest-assured - 3.0.2 test diff --git a/mujina-sp/src/main/java/mujina/MujinaSpApplication.java b/mujina-sp/src/main/java/mujina/MujinaSpApplication.java index 62238131..9e164136 100644 --- a/mujina-sp/src/main/java/mujina/MujinaSpApplication.java +++ b/mujina-sp/src/main/java/mujina/MujinaSpApplication.java @@ -1,14 +1,9 @@ package mujina; import org.springframework.boot.SpringApplication; -import org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.TraceWebFilterAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -@SpringBootApplication(exclude = { - TraceWebFilterAutoConfiguration.class, - MetricFilterAutoConfiguration.class -}) +@SpringBootApplication() public class MujinaSpApplication { public static void main(String[] args) { diff --git a/mujina-sp/src/main/java/mujina/api/SpErrorController.java b/mujina-sp/src/main/java/mujina/api/SpErrorController.java index 8d89332c..d39f95e7 100644 --- a/mujina-sp/src/main/java/mujina/api/SpErrorController.java +++ b/mujina-sp/src/main/java/mujina/api/SpErrorController.java @@ -1,7 +1,7 @@ package mujina.api; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.web.ErrorAttributes; +import org.springframework.boot.web.servlet.error.ErrorAttributes; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/mujina-sp/src/main/java/mujina/sp/SAMLConfig.java b/mujina-sp/src/main/java/mujina/sp/SAMLConfig.java index 517545e7..942f375b 100644 --- a/mujina-sp/src/main/java/mujina/sp/SAMLConfig.java +++ b/mujina-sp/src/main/java/mujina/sp/SAMLConfig.java @@ -18,6 +18,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; +import org.springframework.core.env.Profiles; import org.springframework.security.core.AuthenticationException; import org.springframework.security.saml.SAMLBootstrap; import org.springframework.security.saml.context.SAMLMessageContext; @@ -131,7 +132,7 @@ public SAMLDefaultLogger samlLogger() { @Bean public WebSSOProfileConsumer webSSOprofileConsumer() { - WebSSOProfileConsumerImpl webSSOProfileConsumer = environment.acceptsProfiles("test") ? + WebSSOProfileConsumerImpl webSSOProfileConsumer = environment.acceptsProfiles(Profiles.of("test")) ? new WebSSOProfileConsumerImpl() { @Override @SuppressWarnings("unchecked") diff --git a/mujina-sp/src/test/java/mujina/AbstractIntegrationTest.java b/mujina-sp/src/test/java/mujina/AbstractIntegrationTest.java index af27e7c7..4360f6c8 100644 --- a/mujina-sp/src/test/java/mujina/AbstractIntegrationTest.java +++ b/mujina-sp/src/test/java/mujina/AbstractIntegrationTest.java @@ -7,8 +7,8 @@ import org.junit.Before; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.embedded.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.core.io.ClassPathResource; import org.springframework.test.context.junit4.SpringRunner; diff --git a/pom.xml b/pom.xml index 95cd39c2..e5380fc6 100644 --- a/pom.xml +++ b/pom.xml @@ -27,13 +27,13 @@ UTF-8 1.8 4.5.6 - 1.0.4.RELEASE + 1.0.9.RELEASE org.springframework.boot spring-boot-starter-parent - 1.5.18.RELEASE + 2.1.6.RELEASE