Skip to content

Commit 02a49c8

Browse files
turn off basic auth for prod (#222)
1 parent 58cd234 commit 02a49c8

File tree

2 files changed

+1
-35
lines changed

2 files changed

+1
-35
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
package org.ladocuploader.app.config;
22

3-
43
import org.springframework.context.annotation.Bean;
54
import org.springframework.context.annotation.Configuration;
6-
import org.springframework.context.annotation.Profile;
7-
import org.springframework.security.config.Customizer;
85
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
9-
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
10-
import org.springframework.security.config.http.SessionCreationPolicy;
116
import org.springframework.security.web.SecurityFilterChain;
127

138
@Configuration
14-
@EnableWebSecurity
15-
@Profile({"prod"})
169
public class SecurityConfiguration {
1710
@Bean
1811
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
19-
http
20-
.authorizeHttpRequests((authorize) -> {
21-
try {
22-
authorize.anyRequest().authenticated();
23-
} catch (Exception e) {
24-
throw new RuntimeException(e);
25-
}
26-
}).httpBasic(Customizer.withDefaults());
12+
http.httpBasic().disable();
2713
return http.build();
2814
}
2915
}
30-

src/main/java/org/ladocuploader/app/config/TestSecurity.java

-19
This file was deleted.

0 commit comments

Comments
 (0)