Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
41 changes: 20 additions & 21 deletions src/main/java/com/gateway/fallback/FallbackController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,48 @@
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<String> 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);
}


@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<String> 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<String> 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<String> 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<String> 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<String> 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<String> 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.");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Corregir error ortográfico.

Falta tilde en "autenticación".

Aplica este diff:

-                .body("El servicio de autenticacion no está disponible en este momento. Por favor, inténtalo más tarde.");
+                .body("El servicio de autenticación no está disponible en este momento. Por favor, inténtalo más tarde.");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.body("El servicio de autenticacion no está disponible en este momento. Por favor, inténtalo más tarde.");
.body("El servicio de autentición no está disponible en este momento. Por favor, inténtalo más tarde.");
🤖 Prompt for AI Agents
In src/main/java/com/gateway/fallback/FallbackController.java around line 52,
the response message string has a missing accent in "autenticación"; update the
literal to "El servicio de autenticación no está disponible en este momento. Por
favor, inténtalo más tarde." so the word "autenticación" includes the proper
tilde.

}


}
11 changes: 5 additions & 6 deletions src/main/java/com/gateway/security/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down