Skip to content

Commit 9c97fa4

Browse files
committed
Remove actuator basic auth (will be replaced by cluster)
1 parent bdf14d3 commit 9c97fa4

3 files changed

Lines changed: 0 additions & 39 deletions

File tree

src/main/java/org/patinanetwork/codebloom/api/auth/security/SecurityActuatorProperties.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/java/org/patinanetwork/codebloom/api/auth/security/SecurityConfig.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package org.patinanetwork.codebloom.api.auth.security;
22

3-
import org.springframework.boot.context.properties.EnableConfigurationProperties;
43
import org.springframework.context.annotation.Bean;
54
import org.springframework.context.annotation.Configuration;
65
import org.springframework.core.annotation.Order;
76
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
87
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
98
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
109
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
11-
import org.springframework.security.core.userdetails.User;
12-
import org.springframework.security.core.userdetails.UserDetailsService;
13-
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
1410
import org.springframework.security.web.SecurityFilterChain;
1511
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
1612

@@ -20,7 +16,6 @@
2016
* @see <a href= "https://github.com/tahminator/codebloom/tree/main/docs/auth.md">Authentication Documentation</a>
2117
*/
2218
@Configuration
23-
@EnableConfigurationProperties(SecurityActuatorProperties.class)
2419
@EnableWebSecurity
2520
public class SecurityConfig {
2621

@@ -30,29 +25,6 @@ public SecurityConfig(final AuthenticationSuccessHandler customAuthenticationSuc
3025
this.customAuthenticationSuccessHandler = customAuthenticationSuccessHandler;
3126
}
3227

33-
@Bean
34-
UserDetailsService userDetailsService(SecurityActuatorProperties props) {
35-
return new InMemoryUserDetailsManager(User.withUsername(props.username())
36-
.password("{noop}" + props.password())
37-
.roles("ACTUATOR")
38-
.build());
39-
}
40-
41-
/**
42-
* Security filter chain for actuator endpoints with HTTP Basic authentication. This needs to be processed first
43-
* (Order 1) to prevent OAuth from being applied.
44-
*/
45-
@Bean
46-
@Order(1)
47-
public SecurityFilterChain actuatorSecurityFilterChain(final HttpSecurity http) throws Exception {
48-
http.securityMatcher("/actuator/**")
49-
.csrf(AbstractHttpConfigurer::disable)
50-
.authorizeHttpRequests(auth -> auth.anyRequest().hasRole("ACTUATOR"))
51-
.httpBasic(basic -> {});
52-
53-
return http.build();
54-
}
55-
5628
@Bean
5729
@Order(2)
5830
SecurityFilterChain embedSecurity(HttpSecurity http) throws Exception {

src/main/resources/application.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ management:
106106
prometheus:
107107
enabled: true
108108

109-
security:
110-
actuator:
111-
username: ${ACTUATOR_USERNAME}
112-
password: ${ACTUATOR_PASSWORD}
113-
114109
secret:
115110
key: ${SECRET_KEY}
116111

0 commit comments

Comments
 (0)