diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 194dc3b..aba3e12 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -2,14 +2,41 @@ spring: cloud: gateway: routes: - - id: user-service-public + - id: user-private uri: http://localhost:8081 predicates: - - Path=/v1/users/signup, /v1/users/login + - Path=/v1/users/** + filters: + - AuthenticationFilter - - id: user-service-private + - id: auth-public uri: http://localhost:8081 predicates: - - Path=/v1/users/** + - name: Path + args: + patterns: + - /v1/auth/login + - /v1/auth/register + - /v1/auth/token/refresh + - /v1/auth/email-verification/request + - /v1/auth/email-verification + - /v1/auth/password-reset/request + - /v1/auth/password-reset + - /v1/oauth2/callback/* + + - id: auth-private + uri: http://localhost:8081 + predicates: + - name: Path + args: + patterns: + - /v1/auth/logout + - /v1/auth/password + - /v1/auth/social-links + - /v1/auth/social-links/* + - /v1/oauth2/authorization/* filters: - AuthenticationFilter + +jwt: + secret: "55ca298dcfc216e215622e3f48a251abaa4e8bb973074f065ab170e311acc15811d01a2407290c3ac143648196306d4a6f666a4ed364d3df633e08eb184bb0aea0f2edde4fd2d7fa68ea95ddbc421ff532ce47bde775975911042d665bc22d88a9fa26a03bb4d25530b8cdeb1247d87c9e3efcd721e368b0566b00a43308a729" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0169d95..eb351dd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -7,21 +7,49 @@ spring: cloud: gateway: + default-filters: + - RemoveRequestHeader=X-User-Id + - RemoveRequestHeader=X-User-Email + - RemoveRequestHeader=X-User-Role routes: - - id: user-service-public + - id: user-private uri: http://user-service:8081 predicates: - - Path=/v1/users/signup, /v1/users/login + - Path=/v1/users/** + filters: + - AuthenticationFilter - - id: user-service-private + - id: auth-public uri: http://user-service:8081 predicates: - - Path=/v1/users/** + - name: Path + args: + patterns: + - /v1/auth/login + - /v1/auth/register + - /v1/auth/token/refresh + - /v1/auth/email-verification/request + - /v1/auth/email-verification + - /v1/auth/password-reset/request + - /v1/auth/password-reset + - /v1/oauth2/callback/* + + - id: auth-private + uri: http://user-service:8081 + predicates: + - name: Path + args: + patterns: + - /v1/auth/logout + - /v1/auth/password + - /v1/auth/social-links + - /v1/auth/social-links/* + - /v1/oauth2/authorization/* filters: - AuthenticationFilter jwt: - secret: ${JWT_SECRET:"55ca298dcfc216e215622e3f48a251abaa4e8bb973074f065ab170e311acc15811d01a2407290c3ac143648196306d4a6f666a4ed364d3df633e08eb184bb0aea0f2edde4fd2d7fa68ea95ddbc421ff532ce47bde775975911042d665bc22d88a9fa26a03bb4d25530b8cdeb1247d87c9e3efcd721e368b0566b00a43308a729"} + secret: ${JWT_SECRET} management: endpoints: @@ -31,5 +59,4 @@ management: logging: level: - org.springframework.cloud.gateway: DEBUG - flipnote.apigateway: DEBUG + flipnote.apigateway: INFO