health check

This commit is contained in:
Hyojin Ahn 2026-06-09 11:47:04 -04:00
parent 3000b111ec
commit 3b5cb79f7e
3 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// ---- OpenAPI / Swagger UI ---- // ---- OpenAPI / Swagger UI ----
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdocVersion}" implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:${springdocVersion}"

View File

@ -18,6 +18,9 @@ import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.boot.actuate.health.HealthEndpoint;
//import static com.goi.erp.user.Permission.ADMIN_CREATE; //import static com.goi.erp.user.Permission.ADMIN_CREATE;
//import static com.goi.erp.user.Permission.ADMIN_DELETE; //import static com.goi.erp.user.Permission.ADMIN_DELETE;
//import static com.goi.erp.user.Permission.ADMIN_READ; //import static com.goi.erp.user.Permission.ADMIN_READ;
@ -84,6 +87,7 @@ public class SecurityConfiguration {
.csrf(AbstractHttpConfigurer::disable) .csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(req -> .authorizeHttpRequests(req ->
req.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll() req.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers(EndpointRequest.to(HealthEndpoint.class)).permitAll()
.requestMatchers("/auth/login", "/auth/token/refresh", "/auth/login/system").permitAll() .requestMatchers("/auth/login", "/auth/token/refresh", "/auth/login/system").permitAll()
.requestMatchers("/auth/logout").authenticated() .requestMatchers("/auth/logout").authenticated()
.requestMatchers(WHITE_LIST_URL) .requestMatchers(WHITE_LIST_URL)

View File

@ -1,6 +1,6 @@
spring: spring:
datasource: datasource:
url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/${DB_NAME:goi} url: jdbc:postgresql://${DB_HOST}:${DB_PORT:5432}/${DB_NAME:goi}?currentSchema=${DB_SCHEMA}
username: ${DB_USER} username: ${DB_USER}
password: ${DB_PASSWORD} password: ${DB_PASSWORD}
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver