From 78c02a75796143fa66feebf5808c8637c99c1ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gst=C3=B6hl?= Date: Tue, 15 Mar 2022 18:12:21 +0100 Subject: [PATCH] remove password encoder again --- .../sdk/config/ws/config/ActuatorSecurity.java | 16 +--------------- .../sdk/config/ws/GaenConfigControllerTest.java | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/dpppt-config-backend/src/main/java/org/dpppt/switzerland/backend/sdk/config/ws/config/ActuatorSecurity.java b/dpppt-config-backend/src/main/java/org/dpppt/switzerland/backend/sdk/config/ws/config/ActuatorSecurity.java index d226e4d..2f9aad8 100644 --- a/dpppt-config-backend/src/main/java/org/dpppt/switzerland/backend/sdk/config/ws/config/ActuatorSecurity.java +++ b/dpppt-config-backend/src/main/java/org/dpppt/switzerland/backend/sdk/config/ws/config/ActuatorSecurity.java @@ -6,7 +6,6 @@ import org.springframework.boot.actuate.info.InfoEndpoint; import org.springframework.boot.actuate.logging.LoggersEndpoint; import org.springframework.boot.actuate.metrics.export.prometheus.PrometheusScrapeEndpoint; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.Ordered; @@ -15,8 +14,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.crypto.password.PasswordEncoder; @Configuration @Order(Ordered.HIGHEST_PRECEDENCE + 9) @@ -31,13 +28,6 @@ public class ActuatorSecurity extends WebSecurityConfigurerAdapter { @Value("${ws.monitor.prometheus.password}") private String password; - - @Bean - ActuatorSecurityConfig passwordDefault() { - return new ActuatorSecurityConfig( - user, password); - } - @Override protected void configure(HttpSecurity http) throws Exception { http.requestMatcher( @@ -74,13 +64,9 @@ protected void configure( throws Exception { auth.inMemoryAuthentication() .withUser(user) - .password(passwordEncoder().encode(password)) + .password(password) .roles(PROMETHEUS_ROLE); } - @Bean - public PasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } } diff --git a/dpppt-config-backend/src/test/java/org/dpppt/switzerland/backend/sdk/config/ws/GaenConfigControllerTest.java b/dpppt-config-backend/src/test/java/org/dpppt/switzerland/backend/sdk/config/ws/GaenConfigControllerTest.java index 1a47766..c6fa735 100644 --- a/dpppt-config-backend/src/test/java/org/dpppt/switzerland/backend/sdk/config/ws/GaenConfigControllerTest.java +++ b/dpppt-config-backend/src/test/java/org/dpppt/switzerland/backend/sdk/config/ws/GaenConfigControllerTest.java @@ -25,7 +25,7 @@ @SpringBootTest( properties = { "ws.monitor.prometheus.user=prometheus", - "ws.monitor.prometheus.password=prometheus", + "ws.monitor.prometheus.password={noop}prometheus", "management.endpoints.enabled-by-default=true", "management.endpoints.web.exposure.include=*" })