From 860b154521cea42b8acb546b5f6bb15d24d1ad8f Mon Sep 17 00:00:00 2001 From: Martin Alig Date: Tue, 14 Dec 2021 17:47:48 +0100 Subject: [PATCH] Update Spring Boot Update Spring Boot, fix annotation, make Kotlin happy again, fix Jacoco. --- .../pom.xml | 4 +- .../pom.xml | 2 +- .../check/ws/config/ActuatorSecurity.java | 58 +++++++++---------- .../pom.xml | 6 +- 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-report/pom.xml b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-report/pom.xml index 64e3dbc..c702591 100644 --- a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-report/pom.xml +++ b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-report/pom.xml @@ -32,7 +32,7 @@ org.jacoco jacoco-maven-plugin - 0.8.5 + 0.8.7 report-aggregate @@ -46,4 +46,4 @@ - \ No newline at end of file + diff --git a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/pom.xml b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/pom.xml index 1e042fb..7cba395 100644 --- a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/pom.xml +++ b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/pom.xml @@ -225,7 +225,7 @@ org.jacoco jacoco-maven-plugin - 0.8.5 + 0.8.7 diff --git a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/config/ActuatorSecurity.java b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/config/ActuatorSecurity.java index a200d05..cd96a87 100644 --- a/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/config/ActuatorSecurity.java +++ b/ch-covidcertificate-backend-verification-check/ch-covidcertificate-backend-verification-check-ws/src/main/java/ch/admin/bag/covidcertificate/backend/verification/check/ws/config/ActuatorSecurity.java @@ -11,7 +11,6 @@ package ch.admin.bag.covidcertificate.backend.verification.check.ws.config; import ch.admin.bag.covidcertificate.backend.verification.check.ws.config.configbeans.ActuatorSecurityConfig; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.actuate.health.HealthEndpoint; import org.springframework.boot.actuate.info.InfoEndpoint; @@ -49,40 +48,39 @@ ActuatorSecurityConfig passwordDefault() { @Override protected void configure(HttpSecurity http) throws Exception { http.requestMatcher( - org.springframework.boot.actuate.autoconfigure.security.servlet - .EndpointRequest.toAnyEndpoint()) - .authorizeRequests() - .requestMatchers( - org.springframework.boot.actuate.autoconfigure.security.servlet - .EndpointRequest.to(HealthEndpoint.class)) - .permitAll() - .requestMatchers( - org.springframework.boot.actuate.autoconfigure.security.servlet - .EndpointRequest.to(InfoEndpoint.class)) - .permitAll() - .requestMatchers( - org.springframework.boot.actuate.autoconfigure.security.servlet - .EndpointRequest.to(LoggersEndpoint.class)) - .hasRole(PROMETHEUS_ROLE) - .requestMatchers( - org.springframework.boot.actuate.autoconfigure.security.servlet - .EndpointRequest.to(PrometheusScrapeEndpoint.class)) - .hasRole(PROMETHEUS_ROLE) - .anyRequest() - .denyAll() - .and() - .httpBasic(); + org.springframework.boot.actuate.autoconfigure.security.servlet + .EndpointRequest.toAnyEndpoint()) + .authorizeRequests() + .requestMatchers( + org.springframework.boot.actuate.autoconfigure.security.servlet + .EndpointRequest.to(HealthEndpoint.class)) + .permitAll() + .requestMatchers( + org.springframework.boot.actuate.autoconfigure.security.servlet + .EndpointRequest.to(InfoEndpoint.class)) + .permitAll() + .requestMatchers( + org.springframework.boot.actuate.autoconfigure.security.servlet + .EndpointRequest.to(LoggersEndpoint.class)) + .hasRole(PROMETHEUS_ROLE) + .requestMatchers( + org.springframework.boot.actuate.autoconfigure.security.servlet + .EndpointRequest.to(PrometheusScrapeEndpoint.class)) + .hasRole(PROMETHEUS_ROLE) + .anyRequest() + .denyAll() + .and() + .httpBasic(); http.csrf().ignoringAntMatchers("/actuator/loggers/**"); } - @Autowired protected void configureGlobal( - AuthenticationManagerBuilder auth, ActuatorSecurityConfig securityConfig) - throws Exception { + AuthenticationManagerBuilder auth, ActuatorSecurityConfig securityConfig) + throws Exception { auth.inMemoryAuthentication() - .withUser(securityConfig.getUsername()) - .password(securityConfig.getPassword()) - .roles(PROMETHEUS_ROLE); + .withUser(securityConfig.getUsername()) + .password(securityConfig.getPassword()) + .roles(PROMETHEUS_ROLE); } } diff --git a/ch-covidcertificate-backend-verification-check/pom.xml b/ch-covidcertificate-backend-verification-check/pom.xml index 0edde36..9ee2c09 100644 --- a/ch-covidcertificate-backend-verification-check/pom.xml +++ b/ch-covidcertificate-backend-verification-check/pom.xml @@ -18,13 +18,13 @@ 11 - 1.4.32 + 1.6.0 UTF-8 UTF-8 - 2.5.3 - 3.0.3 + 2.6.1 + 3.1.0 2.11.1 2.0.7.RELEASE