diff --git a/API-Gateway/pom.xml b/API-Gateway/pom.xml
index 6623607..0925a55 100644
--- a/API-Gateway/pom.xml
+++ b/API-Gateway/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.14
+ 3.2.12
org.training
@@ -15,7 +15,7 @@
API Gateway
17
- 2021.0.8
+ 2023.0.4
diff --git a/API-Gateway/src/main/java/org/training/api/gateway/ApiGatewayApplication.java b/API-Gateway/src/main/java/org/training/api/gateway/ApiGatewayApplication.java
index 5d16c71..5c7a3ef 100644
--- a/API-Gateway/src/main/java/org/training/api/gateway/ApiGatewayApplication.java
+++ b/API-Gateway/src/main/java/org/training/api/gateway/ApiGatewayApplication.java
@@ -2,10 +2,8 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
-@EnableEurekaClient
public class ApiGatewayApplication {
public static void main(String[] args) {
diff --git a/API-Gateway/src/main/java/org/training/api/gateway/config/SecurityConfig.java b/API-Gateway/src/main/java/org/training/api/gateway/config/SecurityConfig.java
index a028a68..1b9bc3e 100644
--- a/API-Gateway/src/main/java/org/training/api/gateway/config/SecurityConfig.java
+++ b/API-Gateway/src/main/java/org/training/api/gateway/config/SecurityConfig.java
@@ -6,6 +6,8 @@
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
+import static org.springframework.security.config.Customizer.withDefaults;
+
@Configuration
@EnableWebFluxSecurity
public class SecurityConfig {
@@ -13,17 +15,13 @@ public class SecurityConfig {
@Bean
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
http
- .authorizeExchange()
- //ALLOWING REGISTER API FOR DIRECT ACCESS
- .pathMatchers("/api/users/register").permitAll()
- //ALL OTHER APIS ARE AUTHENTICATED
- .anyExchange().authenticated()
- .and()
- .csrf().disable()
- .oauth2Login()
- .and()
- .oauth2ResourceServer()
- .jwt();
+ .authorizeExchange(exchanges -> exchanges
+ .pathMatchers("/api/users/register").permitAll()
+ .anyExchange().authenticated()
+ )
+ .csrf(csrf -> csrf.disable())
+ .oauth2Login(withDefaults())
+ .oauth2ResourceServer(oauth2 -> oauth2.jwt(withDefaults()));
return http.build();
}
-}
\ No newline at end of file
+}
diff --git a/Account-Service/pom.xml b/Account-Service/pom.xml
index 3d4401c..2750a9c 100644
--- a/Account-Service/pom.xml
+++ b/Account-Service/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.7.15
+ 3.2.12
org.training
@@ -15,7 +15,7 @@
Account Service
17
- 2021.0.8
+ 2023.0.4
diff --git a/Account-Service/src/main/java/org/training/account/service/exception/GlobalExceptionHandler.java b/Account-Service/src/main/java/org/training/account/service/exception/GlobalExceptionHandler.java
index ac70343..9e53140 100644
--- a/Account-Service/src/main/java/org/training/account/service/exception/GlobalExceptionHandler.java
+++ b/Account-Service/src/main/java/org/training/account/service/exception/GlobalExceptionHandler.java
@@ -3,6 +3,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
+import org.springframework.http.HttpStatusCode;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -27,13 +28,13 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
*
* @param ex The MethodArgumentNotValidException that occurred.
* @param headers The HttpHeaders of the response.
- * @param status The HttpStatus of the response.
+ * @param status The HttpStatusCode of the response.
* @param request The WebRequest of the response.
* @return A ResponseEntity with an ErrorResponse and HttpStatus.BAD_REQUEST.
*/
@Override
public ResponseEntity