SpringSecurity: minimal do-nothing implementtaion

- add SpringSecurity dependancie
- Minimal do-nothing SecurityConfig.java
This commit is contained in:
djmil 2023-07-23 14:50:20 +02:00
parent 6cd4088522
commit 7963542c9b
2 changed files with 28 additions and 0 deletions

View File

@ -21,6 +21,8 @@ dependencies {
implementation 'org.springframework.data:spring-data-jdbc' implementation 'org.springframework.data:spring-data-jdbc'
testImplementation 'com.h2database:h2' testImplementation 'com.h2database:h2'
implementation 'org.springframework.boot:spring-boot-starter-security'
} }
tasks.named('test') { tasks.named('test') {

View File

@ -0,0 +1,26 @@
package djmil.cashcard;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.security.web.SecurityFilterChain;
@Configuration
public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http.build();
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}