Skip to content

Commit

Permalink
feat: 헬스체크 API를 위한 actuator 설정 (#54)
Browse files Browse the repository at this point in the history
* fix: 존재하지 않는 설정파일 제거

* feat: url에 따른 인증 설정 추가

* feat: 액추에이터 설정 추가
  • Loading branch information
uwoobeat authored Feb 11, 2024
1 parent f6865b9 commit cc99a4c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ dependencies {

// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'

// Actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
}

tasks.named('test') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.addFilterAfter(jwtExceptionFilter(objectMapper), LogoutFilter.class);
http.addFilterAfter(jwtFilter(jwtService, cookieUtil), LogoutFilter.class);

http.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/oauth2/**")
.permitAll()
.requestMatchers("/gdsc-actuator/**")
.permitAll()
.requestMatchers("/onboarding/**")
.authenticated()
.requestMatchers("/admin/**")
.hasRole("ADMIN")
.anyRequest()
.authenticated());

return http.build();
}

Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/application-actuator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
management:
endpoints:
web:
exposure:
include: health
base-path: /gdsc-actuator
jmx:
exposure:
exclude: "*"
enabled-by-default: false
endpoint:
health:
enabled: true
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ spring:
dev: "dev, datasource"
include:
- redis
- storage
- security
- swagger
- actuator

logging:
level:
Expand Down

0 comments on commit cc99a4c

Please sign in to comment.