API Gateway 라우팅 경로 수정

User Service AuthController의 실제 경로에 맞게 라우팅 수정:
- 기존: /api/auth/** -> /auth/** (잘못된 경로)
- 수정: /api/auth/** -> /api/v1/auth/** (올바른 경로)

AuthController는 @RequestMapping("/api/v1/auth")로 설정되어 있음
이제 Gateway를 통한 인증 API 호출이 정상 동작함

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
hiondal 2025-09-10 11:07:44 +09:00
parent d5791aa159
commit 08aec4251c
2 changed files with 7 additions and 6 deletions

View File

@ -8,6 +8,7 @@
<entry key="JWT_ACCESS_TOKEN_VALIDITY" value="18000000" /> <entry key="JWT_ACCESS_TOKEN_VALIDITY" value="18000000" />
<entry key="JWT_REFRESH_TOKEN_VALIDITY" value="86400000" /> <entry key="JWT_REFRESH_TOKEN_VALIDITY" value="86400000" />
<entry key="JWT_SECRET" value="nwe5Yo9qaJ6FBD/Thl2/j6/SFAfNwUorAY1ZcWO2KI7uA4bmVLOCPxE9hYuUpRCOkgV2UF2DdHXtqHi3+BU/ecbz2zpHyf/720h48UbA3XOMYOX1sdM+dQ==" /> <entry key="JWT_SECRET" value="nwe5Yo9qaJ6FBD/Thl2/j6/SFAfNwUorAY1ZcWO2KI7uA4bmVLOCPxE9hYuUpRCOkgV2UF2DdHXtqHi3+BU/ecbz2zpHyf/720h48UbA3XOMYOX1sdM+dQ==" />
<entry key="KOS_MOCK_URL" value="http://localhost:8084" />
<entry key="PRODUCT_SERVICE_URL" value="http://localhost:8083" /> <entry key="PRODUCT_SERVICE_URL" value="http://localhost:8083" />
<entry key="SERVER_PORT" value="8080" /> <entry key="SERVER_PORT" value="8080" />
<entry key="SPRING_PROFILES_ACTIVE" value="dev" /> <entry key="SPRING_PROFILES_ACTIVE" value="dev" />

View File

@ -18,10 +18,10 @@ import java.util.Arrays;
* 마이크로서비스별 라우팅 규칙과 CORS 정책을 정의합니다. * 마이크로서비스별 라우팅 규칙과 CORS 정책을 정의합니다.
* *
* 라우팅 구성: * 라우팅 구성:
* - /api/auth/** -> user-service (인증 서비스) * - /api/auth/** -> /api/v1/auth/** (user-service)
* - /api/bills/** -> bill-service (요금조회 서비스) * - /api/bills/** -> /api/v1/bills/** (bill-service)
* - /api/products/** -> product-service (상품변경 서비스) * - /api/products/** -> /products/** (product-service)
* - /api/kos/** -> kos-mock (KOS 목업 서비스) * - /api/kos/** -> /kos/** (kos-mock)
* *
* @author 이개발(백엔더) * @author 이개발(백엔더)
* @version 1.0.0 * @version 1.0.0
@ -56,14 +56,14 @@ public class GatewayConfig {
.path("/api/auth/login", "/api/auth/refresh") .path("/api/auth/login", "/api/auth/refresh")
.and() .and()
.method("POST") .method("POST")
.filters(f -> f.rewritePath("/api/auth/(?<segment>.*)", "/auth/${segment}")) .filters(f -> f.rewritePath("/api/auth/(?<segment>.*)", "/api/v1/auth/${segment}"))
.uri("lb://user-service")) .uri("lb://user-service"))
// Auth Service 라우팅 (인증 필요) // Auth Service 라우팅 (인증 필요)
.route("user-service-authenticated", r -> r .route("user-service-authenticated", r -> r
.path("/api/auth/**") .path("/api/auth/**")
.filters(f -> f .filters(f -> f
.rewritePath("/api/auth/(?<segment>.*)", "/auth/${segment}") .rewritePath("/api/auth/(?<segment>.*)", "/api/v1/auth/${segment}")
.filter(jwtAuthFilter.apply(new JwtAuthenticationGatewayFilterFactory.Config())) .filter(jwtAuthFilter.apply(new JwtAuthenticationGatewayFilterFactory.Config()))
.circuitBreaker(cb -> cb .circuitBreaker(cb -> cb
.setName("user-service-cb") .setName("user-service-cb")