From b8219223bbca1f3df26010c9eb93a6b7f2761e9e Mon Sep 17 00:00:00 2001 From: thguss Date: Fri, 16 Feb 2024 01:10:19 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/sopt/makers/operation/config/SecurityConfig.java | 2 ++ .../sopt/makers/operation/filter/JwtAuthenticationFilter.java | 2 +- scripts/health_check.sh | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/operation-auth/src/main/java/org/sopt/makers/operation/config/SecurityConfig.java b/operation-auth/src/main/java/org/sopt/makers/operation/config/SecurityConfig.java index b3786a58..ce3aa176 100644 --- a/operation-auth/src/main/java/org/sopt/makers/operation/config/SecurityConfig.java +++ b/operation-auth/src/main/java/org/sopt/makers/operation/config/SecurityConfig.java @@ -49,6 +49,7 @@ public SecurityFilterChain filterChainProd(HttpSecurity http) throws Exception { setHttp(http); return http.build(); } + private void setHttp(HttpSecurity http) throws Exception { http.httpBasic().disable() .csrf().disable() @@ -58,6 +59,7 @@ private void setHttp(HttpSecurity http) throws Exception { .authorizeHttpRequests(authorizeHttpRequests -> authorizeHttpRequests .requestMatchers(new AntPathRequestMatcher("/api/v1/auth/*")).permitAll() + .requestMatchers(new AntPathRequestMatcher("/api/v1/test/**")).permitAll() .requestMatchers(new AntPathRequestMatcher("/error")).permitAll() .anyRequest().authenticated()) .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) diff --git a/operation-auth/src/main/java/org/sopt/makers/operation/filter/JwtAuthenticationFilter.java b/operation-auth/src/main/java/org/sopt/makers/operation/filter/JwtAuthenticationFilter.java index eed6ec00..7440b615 100644 --- a/operation-auth/src/main/java/org/sopt/makers/operation/filter/JwtAuthenticationFilter.java +++ b/operation-auth/src/main/java/org/sopt/makers/operation/filter/JwtAuthenticationFilter.java @@ -29,7 +29,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { val uri = request.getRequestURI(); - if ((uri.startsWith("/api/v1")) && !uri.contains("auth")) { + if ((uri.startsWith("/api/v1")) && !uri.contains("auth") && !uri.contains("test")) { val token = jwtTokenProvider.resolveToken(request); val jwtTokenType = validateTokenType(request); diff --git a/scripts/health_check.sh b/scripts/health_check.sh index 9f72a26a..a6390126 100644 --- a/scripts/health_check.sh +++ b/scripts/health_check.sh @@ -13,12 +13,12 @@ else fi -echo "> Start health check of WAS at 'http://127.0.0.1:${TARGET_PORT}' ..." +echo "> Start health check of WAS at 'http://127.0.0.1:${TARGET_PORT}/api/v1/test' ..." for RETRY_COUNT in {1..10} do echo "> #${RETRY_COUNT} trying..." - RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:${TARGET_PORT}) + RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:${TARGET_PORT}/api/v1/test) if [ ${RESPONSE_CODE} -eq 200 ]; then echo "> New WAS successfully running"