health check 추가
This commit is contained in:
parent
a6102f4842
commit
6067d8ff69
|
|
@ -30,6 +30,7 @@ dependencies {
|
|||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
|
||||
// API documentation
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0'
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import lombok.RequiredArgsConstructor;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
|
||||
import org.springframework.boot.actuate.health.HealthEndpoint;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
|
|
@ -31,6 +33,7 @@ public class SecurityConfig {
|
|||
.csrf(csrf -> csrf.disable()) // CSRF 비활성화 (API 서버라면 stateless)
|
||||
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) // 세션 사용 안함
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers(EndpointRequest.to(HealthEndpoint.class)).permitAll()
|
||||
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
) // 요청 권한 설정
|
||||
|
|
|
|||
Loading…
Reference in New Issue