modify
parent
6935a44adf
commit
a9bc0c4495
4
pom.xml
4
pom.xml
|
|
@ -29,6 +29,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
|
|
|
|||
|
|
@ -27,13 +27,14 @@ package kr.co.i4way;
|
|||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EnableEncryptableProperties
|
||||
@SpringBootApplication
|
||||
public class I4WayGenesysServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package kr.co.i4way.config;
|
||||
|
||||
import org.apache.catalina.filters.CorsFilter;
|
||||
import org.springframework.boot.web.servlet.DispatcherType;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
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.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@EnableMethodSecurity
|
||||
public class SpringSecurityConfig {
|
||||
|
||||
private final CorsFilter corsFilter = new CorsFilter();
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||
http
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
|
||||
.sessionManagement(session -> session
|
||||
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
|
||||
)
|
||||
.authorizeHttpRequests(request -> request
|
||||
.requestMatchers(
|
||||
"/version", "/login/google"
|
||||
)
|
||||
.permitAll()
|
||||
)
|
||||
.authorizeHttpRequests(request -> request.anyRequest().authenticated());
|
||||
|
||||
return http.build();
|
||||
}
|
||||
}
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
datasource:
|
||||
mssql:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
jdbc-url: jdbc:sqlserver://10.5.188.139;databasename=HCTIETLPRD;encrypt=true;trustServerCertificate=true
|
||||
username: HCTIETLADM
|
||||
password: ENC(0NvQrV/XiOyxCB+n6xL97JmMw1/kQlUc)
|
||||
jdbc-url: jdbc:sqlserver://172.168.30.61;databasename=RND_TEST;encrypt=true;trustServerCertificate=true
|
||||
username: RND_USER
|
||||
password: ENC(G5u0UcCDMig4HljKNER2qw==)
|
||||
connection-test-query: SELECT 1
|
||||
# mssql-brd:
|
||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
|
|
|
|||
Loading…
Reference in New Issue