[M] Move security config

This commit is contained in:
Azalea
2024-02-19 04:35:08 -05:00
parent 55cfb7b358
commit 500a4b0b7e
2 changed files with 20 additions and 43 deletions

View File

@@ -0,0 +1,20 @@
package icu.samnyan.aqua.spring
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.Customizer
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
import org.springframework.security.web.SecurityFilterChain
@Configuration
@EnableWebSecurity
class SecurityConfig() {
@Bean
fun configure(http: HttpSecurity): SecurityFilterChain = http
.headers { it.disable() }
.cors(Customizer.withDefaults())
.csrf { it.disable() }
.authorizeHttpRequests { it.anyRequest().permitAll() }
.build()
}