From 3b478950ca78a0d27e047674332eceaa60e0dc8f Mon Sep 17 00:00:00 2001 From: Raydberg Gabriel Date: Tue, 7 Oct 2025 21:39:40 -0500 Subject: [PATCH 1/3] feat: actualizar rutas de seguridad para permitir acceso a OAuth2 y pruebas --- .../java/com/gateway/security/SecurityConfig.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gateway/security/SecurityConfig.java b/src/main/java/com/gateway/security/SecurityConfig.java index d191b00..e6f307b 100644 --- a/src/main/java/com/gateway/security/SecurityConfig.java +++ b/src/main/java/com/gateway/security/SecurityConfig.java @@ -41,15 +41,14 @@ public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { "/security/auth/status", "/security/auth/refresh", "/security/auth/register", - "/security/saludo", + "/security/oauth2/**", + "/security/login/oauth2/**", + "/security/test/**", "/auth/logout", "/chat/test/**", + "/billing/payments/**", "/classes/test/**", - "/fallback/**" - // "/**/swagger-ui/**", - // "/**/v3/api-docs/**" - - ) + "/fallback/**") .permitAll() .anyExchange().authenticated()) .oauth2ResourceServer(oauth2 -> oauth2.jwt(Customizer.withDefaults())) From 03ef691aa3378ae97da3788542cc487b7d842da8 Mon Sep 17 00:00:00 2001 From: Raydberg Gabriel Date: Tue, 7 Oct 2025 23:00:56 -0500 Subject: [PATCH 2/3] update --- .../gateway/fallback/FallbackController.java | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/gateway/fallback/FallbackController.java b/src/main/java/com/gateway/fallback/FallbackController.java index aba691f..0915658 100644 --- a/src/main/java/com/gateway/fallback/FallbackController.java +++ b/src/main/java/com/gateway/fallback/FallbackController.java @@ -9,15 +9,7 @@ public class FallbackController { - @RequestMapping(value = "/{service}", method = { - RequestMethod.GET, - RequestMethod.POST, - RequestMethod.PUT, - RequestMethod.DELETE, - RequestMethod.PATCH, - RequestMethod.OPTIONS, - RequestMethod.HEAD - }) + @RequestMapping(value = "/{service}") public ResponseEntity genericServiceFallback(@PathVariable String service) { String body = String.format("El servicio '%s' no está disponible en este momento. Por favor, inténtalo más tarde.", service); return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE).body(body); @@ -25,33 +17,40 @@ public ResponseEntity genericServiceFallback(@PathVariable String servic @GetMapping("/billing") - public String billingServiceFallback() { - return "El servicio de facturación no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity billingServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de facturación no está disponible en este momento. Por favor, inténtalo más tarde."); } @GetMapping("/chat") - public String chatServiceFallback() { - return "El servicio de chat no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity chatServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de chat no está disponible en este momento. Por favor, inténtalo más tarde."); } @GetMapping("/classes") - public String classesServiceFallback() { - return "El servicio de clases no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity classesServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de clases no está disponible en este momento. Por favor, inténtalo más tarde."); } @GetMapping("/members") - public String membersServiceFallback() { - return "El servicio de miembros no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity membersServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de miembros no está disponible en este momento. Por favor, inténtalo más tarde."); } @GetMapping("/notifications") - public String notificationsServiceFallback() { - return "El servicio de notificaciones no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity notificationsServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de notificaciones no está disponible en este momento. Por favor, inténtalo más tarde."); } @GetMapping("/security") - public String securityServiceFallback() { - return "El servicio de autenticacion no está disponible en este momento. Por favor, inténtalo más tarde."; + public ResponseEntity securityServiceFallback() { + return ResponseEntity.status(HttpStatus.SERVICE_UNAVAILABLE) + .body("El servicio de autenticacion no está disponible en este momento. Por favor, inténtalo más tarde."); } + } From 44ff9aa3b914eebc4954b2e938e19c8aba459f26 Mon Sep 17 00:00:00 2001 From: Raydberg Gabriel Date: Tue, 7 Oct 2025 23:06:18 -0500 Subject: [PATCH 3/3] update --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 3667b67..e8fd9a1 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -30,7 +30,7 @@ jobs: -Dsonar.projectKey=$SONAR_PROJECT_KEY \ -Dsonar.organization=$SONAR_ORG_KEY \ -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=$SONAR_TOKEN \ + -Dsonar.token=$SONAR_TOKEN \ -Dsonar.pullrequest.key=$SONAR_PULL_REQUEST_KEY \ -Dsonar.pullrequest.branch=$SONAR_PR_BRANCH \ -Dsonar.pullrequest.base=$SONAR_PULL_REQUEST_BASE \ No newline at end of file