From d812b1cc5f6bf2992c09abd564dea3c3e3368a5d Mon Sep 17 00:00:00 2001 From: fatemeh imanipour Date: Sat, 9 May 2026 16:17:00 +0330 Subject: [PATCH 1/2] Add interceptors dependency to all related modules --- accountant/accountant-app/pom.xml | 4 ++++ accountant/pom.xml | 5 +++++ auth-gateway/auth-gateway-app/pom.xml | 4 ++++ bc-gateway/bc-gateway-app/pom.xml | 8 ++++++++ device-management/device-management-app/pom.xml | 4 ++++ device-management/pom.xml | 5 +++++ docker-compose.yml | 4 ++-- matching-gateway/matching-gateway-app/pom.xml | 4 ++++ otp/otp-app/pom.xml | 4 ++++ profile/pom.xml | 5 +++++ profile/profile-app/pom.xml | 4 ++++ user-management/pom.xml | 5 +++++ 12 files changed, 54 insertions(+), 2 deletions(-) diff --git a/accountant/accountant-app/pom.xml b/accountant/accountant-app/pom.xml index 67649ff75..f56aee06a 100644 --- a/accountant/accountant-app/pom.xml +++ b/accountant/accountant-app/pom.xml @@ -51,6 +51,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + org.springframework.cloud spring-cloud-starter-vault-config diff --git a/accountant/pom.xml b/accountant/pom.xml index 6eded39f6..edce57a88 100644 --- a/accountant/pom.xml +++ b/accountant/pom.xml @@ -82,6 +82,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + org.springframework.cloud spring-cloud-dependencies diff --git a/auth-gateway/auth-gateway-app/pom.xml b/auth-gateway/auth-gateway-app/pom.xml index 0d31ffddd..0ff3a5ade 100644 --- a/auth-gateway/auth-gateway-app/pom.xml +++ b/auth-gateway/auth-gateway-app/pom.xml @@ -80,6 +80,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + com.auth0 java-jwt diff --git a/bc-gateway/bc-gateway-app/pom.xml b/bc-gateway/bc-gateway-app/pom.xml index 2bdccb667..0046a178b 100644 --- a/bc-gateway/bc-gateway-app/pom.xml +++ b/bc-gateway/bc-gateway-app/pom.xml @@ -138,6 +138,14 @@ micrometer-registry-prometheus runtime + + co.nilin.opex.utility + interceptors + + + co.nilin.opex.utility + error-handler + diff --git a/device-management/device-management-app/pom.xml b/device-management/device-management-app/pom.xml index 82e41ff4e..ff9b70048 100644 --- a/device-management/device-management-app/pom.xml +++ b/device-management/device-management-app/pom.xml @@ -78,6 +78,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + com.zaxxer HikariCP diff --git a/device-management/pom.xml b/device-management/pom.xml index d24596637..4800bfa7c 100644 --- a/device-management/pom.xml +++ b/device-management/pom.xml @@ -56,6 +56,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + co.nilin.opex.device-management device-management-core diff --git a/docker-compose.yml b/docker-compose.yml index 63535e6e2..b9078536e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -546,8 +546,8 @@ services: - SMTP_USER=${SMTP_USER} - SMTP_PASS=${SMTP_PASS} - SMTP_FROM=${SMTP_FROM} - - SMTP_SOCKS_HOST=${SMTP_SOCKS_HOST} - - SMTP_SOCKS_PORT=${SMTP_SOCKS_PORT} + - SMTP_PROXY_HOST=${SMTP_PROXY_HOST} + - SMTP_PROXY_PORT=${SMTP_PROXY_PORT} - SMTP_PROXY_ENABLED=${SMTP_PROXY_ENABLED} - TOKEN_ISSUER_URL=${KC_ISSUER_URL} - OTP_CODE_RESPONSE_ENABLED=${OTP_CODE_RESPONSE_ENABLED} diff --git a/matching-gateway/matching-gateway-app/pom.xml b/matching-gateway/matching-gateway-app/pom.xml index 24e94ab58..86d029320 100644 --- a/matching-gateway/matching-gateway-app/pom.xml +++ b/matching-gateway/matching-gateway-app/pom.xml @@ -77,6 +77,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + io.mockk mockk diff --git a/otp/otp-app/pom.xml b/otp/otp-app/pom.xml index 1d3d72124..49cb4f0c0 100644 --- a/otp/otp-app/pom.xml +++ b/otp/otp-app/pom.xml @@ -87,6 +87,10 @@ co.nilin.opex.utility error-handler + + co.nilin.opex.utility + interceptors + io.mockk mockk diff --git a/profile/pom.xml b/profile/pom.xml index 7ac615097..ffd3ab564 100644 --- a/profile/pom.xml +++ b/profile/pom.xml @@ -66,6 +66,11 @@ logging-handler ${logging-handler.version} + + co.nilin.opex.utility + error-handler + ${error-hanlder.version} + co.nilin.opex.utility interceptors diff --git a/profile/profile-app/pom.xml b/profile/profile-app/pom.xml index 685459a22..2b2412044 100644 --- a/profile/profile-app/pom.xml +++ b/profile/profile-app/pom.xml @@ -98,6 +98,10 @@ org.springframework.cloud spring-cloud-starter-vault-config + + co.nilin.opex.utility + error-handler + co.nilin.opex.utility interceptors diff --git a/user-management/pom.xml b/user-management/pom.xml index 0c0b0c5a4..fbb1146c0 100644 --- a/user-management/pom.xml +++ b/user-management/pom.xml @@ -49,6 +49,11 @@ error-handler ${error-hanlder.version} + + co.nilin.opex.utility + interceptors + ${interceptor.version} + co.nilin.opex.auth user-management-core From 5e8a9ea941e39d008f5c85d98c073216b2976989 Mon Sep 17 00:00:00 2001 From: Amir Rajabi Date: Thu, 14 May 2026 16:50:29 +0330 Subject: [PATCH 2/2] update favorite pair service --- .../kotlin/co/nilin/opex/api/core/spi/ConfigProxy.kt | 4 ++-- .../api/ports/opex/controller/ConfigController.kt | 12 ++++++------ .../opex/api/ports/proxy/impl/ConfigProxyImpl.kt | 10 ++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/api/api-core/src/main/kotlin/co/nilin/opex/api/core/spi/ConfigProxy.kt b/api/api-core/src/main/kotlin/co/nilin/opex/api/core/spi/ConfigProxy.kt index af2969e65..7d9753344 100644 --- a/api/api-core/src/main/kotlin/co/nilin/opex/api/core/spi/ConfigProxy.kt +++ b/api/api-core/src/main/kotlin/co/nilin/opex/api/core/spi/ConfigProxy.kt @@ -15,7 +15,7 @@ interface ConfigProxy { suspend fun getUserConfig(token: String): UserWebConfig suspend fun updateUserConfig(token: String, request: UpdateUserConfigRequest): UserWebConfig suspend fun getUserFavoritePair(token: String): Set - suspend fun addUserFavoritePair(token: String, pairs: Set): Set - suspend fun removeUserFavoritePair(token: String, pairs: Set): Set + suspend fun addUserFavoritePair(token: String, pair: String): Set + suspend fun removeUserFavoritePair(token: String, pair: String): Set } diff --git a/api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/ConfigController.kt b/api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/ConfigController.kt index 1c32859a9..c61b07fd2 100644 --- a/api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/ConfigController.kt +++ b/api/api-ports/api-opex-rest/src/main/kotlin/co/nilin/opex/api/ports/opex/controller/ConfigController.kt @@ -69,19 +69,19 @@ class ConfigController(private val configProxy: ConfigProxy) { return configProxy.getUserFavoritePair(securityContext.jwtAuthentication().tokenValue()) } - @PostMapping("/user/config/pair") + @PostMapping("/user/config/pair/{pair}") suspend fun addUserFavoritePair( @CurrentSecurityContext securityContext: SecurityContext, - @RequestBody pairs: Set + @PathVariable pair: String ): Set { - return configProxy.addUserFavoritePair(securityContext.jwtAuthentication().tokenValue(), pairs) + return configProxy.addUserFavoritePair(securityContext.jwtAuthentication().tokenValue(), pair) } - @DeleteMapping("/user/config/pair") + @DeleteMapping("/user/config/pair/{pair}") suspend fun removeUserFavoritePair( @CurrentSecurityContext securityContext: SecurityContext, - @RequestBody pairs: Set + @PathVariable pair: String ): Set { - return configProxy.removeUserFavoritePair(securityContext.jwtAuthentication().tokenValue(), pairs) + return configProxy.removeUserFavoritePair(securityContext.jwtAuthentication().tokenValue(), pair) } } \ No newline at end of file diff --git a/api/api-ports/api-proxy-rest/src/main/kotlin/co/nilin/opex/api/ports/proxy/impl/ConfigProxyImpl.kt b/api/api-ports/api-proxy-rest/src/main/kotlin/co/nilin/opex/api/ports/proxy/impl/ConfigProxyImpl.kt index a6a15f512..7d3e19192 100644 --- a/api/api-ports/api-proxy-rest/src/main/kotlin/co/nilin/opex/api/ports/proxy/impl/ConfigProxyImpl.kt +++ b/api/api-ports/api-proxy-rest/src/main/kotlin/co/nilin/opex/api/ports/proxy/impl/ConfigProxyImpl.kt @@ -140,13 +140,12 @@ class ConfigProxyImpl(@Qualifier("generalWebClient") private val webClient: WebC override suspend fun addUserFavoritePair( token: String, - pairs: Set + pair: String ): Set { return webClient.post() - .uri("$baseUrl/user/v1/pair") + .uri("$baseUrl/user/v1/pair/${pair}") .accept(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, "Bearer $token") - .body(Mono.just(pairs)) .retrieve() .onStatus({ t -> t.isError }, { it.createException() }) .bodyToMono>() @@ -155,14 +154,13 @@ class ConfigProxyImpl(@Qualifier("generalWebClient") private val webClient: WebC override suspend fun removeUserFavoritePair( token: String, - pairs: Set + pair: String ): Set { return webClient.method(HttpMethod.DELETE) - .uri("$baseUrl/user/v1/pair") + .uri("$baseUrl/user/v1/pair/${pair}") .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .header(HttpHeaders.AUTHORIZATION, "Bearer $token") - .bodyValue(pairs) .retrieve() .onStatus({ it.isError }) { it.createException() } .bodyToMono>()