Skip to content

Commit

Permalink
remove password encoder again
Browse files Browse the repository at this point in the history
  • Loading branch information
gstoehld committed Mar 15, 2022
1 parent bad7446 commit 78c02a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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();
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -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=*"
})
Expand Down

0 comments on commit 78c02a7

Please sign in to comment.