From 78f070bc8b8e71b48642c3d4e31ad8bab7d5bab1 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Tue, 3 Aug 2021 15:31:44 +0430 Subject: [PATCH 1/5] Add raw springfox swagger to api, wallet and matching gateway modules --- Api/api-app/pom.xml | 9 ++--- .../kotlin/co/nilin/mixchange/app/ApiApp.kt | 35 +++++++++++++++++-- .../port/api/binance/config/SecurityConfig.kt | 3 ++ MatchingGateway/gateway-app/pom.xml | 5 +++ .../nilin/mixchange/app/MatchingGatewayApp.kt | 31 ++++++++++++++-- .../mixchange/app/config/SecurityConfig.kt | 3 ++ Wallet/wallet-app/pom.xml | 5 +++ .../nilin/mixchange/wallet/app/WalletApp.kt | 30 ++++++++++++++-- 8 files changed, 110 insertions(+), 11 deletions(-) diff --git a/Api/api-app/pom.xml b/Api/api-app/pom.xml index 8cca739d5..29f2c0749 100644 --- a/Api/api-app/pom.xml +++ b/Api/api-app/pom.xml @@ -23,10 +23,6 @@ - - org.springframework.boot - spring-boot-starter - org.jetbrains.kotlin kotlin-reflect @@ -68,6 +64,11 @@ api-persister-postgres ${api.version} + + io.springfox + springfox-boot-starter + 3.0.0 + org.springframework.boot diff --git a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt index 8a9752dba..c63b8987c 100644 --- a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt +++ b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt @@ -2,12 +2,41 @@ package co.nilin.mixchange.app import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.PathSelectors.regex +import springfox.documentation.service.ApiInfo +import springfox.documentation.spi.DocumentationType +import springfox.documentation.spring.web.plugins.Docket +import springfox.documentation.swagger2.annotations.EnableSwagger2 + @SpringBootApplication +@EnableSwagger2 @ComponentScan("co.nilin.mixchange") -class AccountantApp +class ApiApp { + @Bean + fun opexApi(): Docket? { + return Docket(DocumentationType.SWAGGER_2) + .groupName("opex-api") + .apiInfo(apiInfo()) + .select() + .paths(regex("^/api/v3.*")) + .build() + } + + private fun apiInfo(): ApiInfo? { + return ApiInfoBuilder() + .title("OPEX API") + .description("Backend for opex exchange.") + .license("MIT License") + .licenseUrl("https://github.com/opexdev/Back-end/blob/feature/1-MVP/LICENSE") + .version("0.1") + .build() + } +} fun main(args: Array) { - runApplication(*args) -} \ No newline at end of file + runApplication(*args) +} diff --git a/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/config/SecurityConfig.kt b/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/config/SecurityConfig.kt index fb383b506..2186dfb3a 100644 --- a/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/config/SecurityConfig.kt +++ b/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/config/SecurityConfig.kt @@ -23,6 +23,9 @@ class SecurityConfig { .authorizeExchange() .pathMatchers("/hello").permitAll() .pathMatchers("/actuator/**").permitAll() + .pathMatchers("/swagger-ui/**").permitAll() + .pathMatchers("/swagger-resources/**").permitAll() + .pathMatchers("/v2/api-docs").permitAll() .pathMatchers("/**").hasAuthority("SCOPE_trust") .anyExchange().authenticated() .and() diff --git a/MatchingGateway/gateway-app/pom.xml b/MatchingGateway/gateway-app/pom.xml index d34882ea5..b289589e2 100644 --- a/MatchingGateway/gateway-app/pom.xml +++ b/MatchingGateway/gateway-app/pom.xml @@ -84,6 +84,11 @@ bcprov-jdk15on 1.60 + + io.springfox + springfox-boot-starter + 3.0.0 + diff --git a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt index 81b16fdda..d8f76c7a8 100644 --- a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt +++ b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt @@ -2,11 +2,38 @@ package co.nilin.mixchange.app import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.PathSelectors.regex +import springfox.documentation.service.ApiInfo +import springfox.documentation.spi.DocumentationType +import springfox.documentation.spring.web.plugins.Docket @SpringBootApplication @ComponentScan("co.nilin.mixchange") -class MatchingGatewayApp +class MatchingGatewayApp { + @Bean + fun opexMatchingGateway(): Docket? { + return Docket(DocumentationType.SWAGGER_2) + .groupName("opex-matching-gateway") + .apiInfo(apiInfo()) + .select() + .paths(regex("^/actuator.*").negate()) + .build() + } + + private fun apiInfo(): ApiInfo? { + return ApiInfoBuilder() + .title("OPEX API") + .description("Backend for opex exchange.") + .license("MIT License") + .licenseUrl("https://github.com/opexdev/Back-end/blob/feature/1-MVP/LICENSE") + .version("0.1") + .build() + } +} + fun main(args: Array) { - runApplication(*args) + runApplication(*args) } \ No newline at end of file diff --git a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/config/SecurityConfig.kt b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/config/SecurityConfig.kt index 2048a7616..4b8efc7e5 100644 --- a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/config/SecurityConfig.kt +++ b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/config/SecurityConfig.kt @@ -22,6 +22,9 @@ class SecurityConfig { .authorizeExchange() .pathMatchers("/hello").permitAll() .pathMatchers("/actuator/**").permitAll() + .pathMatchers("/swagger-ui/**").permitAll() + .pathMatchers("/swagger-resources/**").permitAll() + .pathMatchers("/v2/api-docs").permitAll() .pathMatchers("/**").hasAuthority("SCOPE_trust") .anyExchange().authenticated() .and() diff --git a/Wallet/wallet-app/pom.xml b/Wallet/wallet-app/pom.xml index 59a665e79..49ba353d7 100644 --- a/Wallet/wallet-app/pom.xml +++ b/Wallet/wallet-app/pom.xml @@ -107,6 +107,11 @@ bcprov-jdk15on 1.60 + + io.springfox + springfox-boot-starter + 3.0.0 + diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt index a02438a63..8932d6730 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt @@ -2,12 +2,38 @@ package co.nilin.mixchange.wallet.app import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication +import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.PathSelectors.regex +import springfox.documentation.service.ApiInfo +import springfox.documentation.spi.DocumentationType +import springfox.documentation.spring.web.plugins.Docket @SpringBootApplication @ComponentScan("co.nilin.mixchange") -class WalletApp +class WalletApp { + @Bean + fun opexWallet(): Docket? { + return Docket(DocumentationType.SWAGGER_2) + .groupName("opex-wallet") + .apiInfo(apiInfo()) + .select() + .paths(regex("^/actuator.*").negate()) + .build() + } + + private fun apiInfo(): ApiInfo? { + return ApiInfoBuilder() + .title("OPEX API") + .description("Backend for opex exchange.") + .license("MIT License") + .licenseUrl("https://github.com/opexdev/Back-end/blob/feature/1-MVP/LICENSE") + .version("0.1") + .build() + } +} fun main(args: Array) { - runApplication(*args) + runApplication(*args) } From b0fbe089629a69d014af1d206379d43d5a04be16 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Sat, 7 Aug 2021 14:24:40 +0430 Subject: [PATCH 2/5] Add authentication to swagger --- .../kotlin/co/nilin/mixchange/app/ApiApp.kt | 61 +++++++++++++++++- .../nilin/mixchange/app/MatchingGatewayApp.kt | 62 +++++++++++++++++- .../nilin/mixchange/wallet/app/WalletApp.kt | 64 ++++++++++++++++++- 3 files changed, 183 insertions(+), 4 deletions(-) diff --git a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt index c63b8987c..e869379d3 100644 --- a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt +++ b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt @@ -4,12 +4,16 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan -import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.* import springfox.documentation.builders.PathSelectors.regex -import springfox.documentation.service.ApiInfo +import springfox.documentation.service.* import springfox.documentation.spi.DocumentationType +import springfox.documentation.spi.service.contexts.SecurityContext import springfox.documentation.spring.web.plugins.Docket +import springfox.documentation.swagger.web.SecurityConfiguration +import springfox.documentation.swagger.web.SecurityConfigurationBuilder import springfox.documentation.swagger2.annotations.EnableSwagger2 +import java.util.Collections.singletonList @SpringBootApplication @@ -24,6 +28,18 @@ class ApiApp { .select() .paths(regex("^/api/v3.*")) .build() + .globalRequestParameters( + singletonList( + RequestParameterBuilder() + .name("content-type") + .description("content-type") + .`in`(ParameterType.HEADER) + .required(true) + .build() + ) + ) + .securitySchemes(singletonList(oauth())) + .securityContexts(singletonList(securityContext())) } private fun apiInfo(): ApiInfo? { @@ -35,6 +51,47 @@ class ApiApp { .version("0.1") .build() } + + @Bean + fun oauth(): SecurityScheme? { + return OAuthBuilder() + .name("opex") + .grantTypes(grantTypes()) + .scopes(scopes()) + .build() + } + + fun scopes(): List? { + return emptyList() + } + + fun grantTypes(): List? { + val tokenUrl = "http://localhost:8083/auth/realms/mixchange/protocol/openid-connect/token" + val grantType = ResourceOwnerPasswordCredentialsGrant(tokenUrl) + return singletonList(grantType) + } + + @Bean + fun securityContext(): SecurityContext? { + val securityReference = SecurityReference.builder() + .reference("opex") + .scopes(emptyArray()) + .build() + return SecurityContext.builder() + .securityReferences(singletonList(securityReference)) + .operationSelector { true } + .build() + } + + @Bean + fun securityInfo(): SecurityConfiguration? { + return SecurityConfigurationBuilder.builder() + .clientId("admin-cli") + .realm("mixchange") + .appName("opex") + .scopeSeparator(",") + .build() + } } fun main(args: Array) { diff --git a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt index d8f76c7a8..900620766 100644 --- a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt +++ b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt @@ -5,10 +5,17 @@ import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.OAuthBuilder import springfox.documentation.builders.PathSelectors.regex -import springfox.documentation.service.ApiInfo +import springfox.documentation.builders.RequestParameterBuilder +import springfox.documentation.service.* import springfox.documentation.spi.DocumentationType +import springfox.documentation.spi.service.contexts.SecurityContext import springfox.documentation.spring.web.plugins.Docket +import springfox.documentation.swagger.web.SecurityConfiguration +import springfox.documentation.swagger.web.SecurityConfigurationBuilder +import java.util.* +import java.util.Collections.singletonList @SpringBootApplication @ComponentScan("co.nilin.mixchange") @@ -21,6 +28,18 @@ class MatchingGatewayApp { .select() .paths(regex("^/actuator.*").negate()) .build() + .globalRequestParameters( + singletonList( + RequestParameterBuilder() + .name("content-type") + .description("content-type") + .`in`(ParameterType.HEADER) + .required(true) + .build() + ) + ) + .securitySchemes(singletonList(oauth())) + .securityContexts(singletonList(securityContext())) } private fun apiInfo(): ApiInfo? { @@ -32,6 +51,47 @@ class MatchingGatewayApp { .version("0.1") .build() } + + @Bean + fun oauth(): SecurityScheme? { + return OAuthBuilder() + .name("opex") + .grantTypes(grantTypes()) + .scopes(scopes()) + .build() + } + + fun scopes(): List? { + return emptyList() + } + + fun grantTypes(): List? { + val tokenUrl = "http://localhost:8083/auth/realms/mixchange/protocol/openid-connect/token" + val grantType = ResourceOwnerPasswordCredentialsGrant(tokenUrl) + return singletonList(grantType) + } + + @Bean + fun securityContext(): SecurityContext? { + val securityReference = SecurityReference.builder() + .reference("opex") + .scopes(emptyArray()) + .build() + return SecurityContext.builder() + .securityReferences(singletonList(securityReference)) + .operationSelector { true } + .build() + } + + @Bean + fun securityInfo(): SecurityConfiguration? { + return SecurityConfigurationBuilder.builder() + .clientId("admin-cli") + .realm("mixchange") + .appName("opex") + .scopeSeparator(",") + .build() + } } fun main(args: Array) { diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt index 8932d6730..bbf35740f 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt @@ -5,10 +5,17 @@ import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan import springfox.documentation.builders.ApiInfoBuilder +import springfox.documentation.builders.OAuthBuilder import springfox.documentation.builders.PathSelectors.regex -import springfox.documentation.service.ApiInfo +import springfox.documentation.builders.RequestParameterBuilder +import springfox.documentation.service.* import springfox.documentation.spi.DocumentationType +import springfox.documentation.spi.service.contexts.SecurityContext import springfox.documentation.spring.web.plugins.Docket +import springfox.documentation.swagger.web.SecurityConfiguration +import springfox.documentation.swagger.web.SecurityConfigurationBuilder +import java.util.* +import java.util.Collections.singletonList @SpringBootApplication @ComponentScan("co.nilin.mixchange") @@ -21,6 +28,18 @@ class WalletApp { .select() .paths(regex("^/actuator.*").negate()) .build() + .globalRequestParameters( + singletonList( + RequestParameterBuilder() + .name("content-type") + .description("content-type") + .`in`(ParameterType.HEADER) + .required(true) + .build() + ) + ) + .securitySchemes(singletonList(oauth())) + .securityContexts(singletonList(securityContext())) } private fun apiInfo(): ApiInfo? { @@ -32,6 +51,49 @@ class WalletApp { .version("0.1") .build() } + + @Bean + fun oauth(): SecurityScheme? { + return OAuthBuilder() + .name("opex") + .grantTypes(grantTypes()) + .scopes(scopes()) + .build() + } + + fun scopes(): List? { + return emptyList() + } + + fun grantTypes(): List? { + val tokenUrl = "http://localhost:8083/auth/realms/mixchange/protocol/openid-connect/token" + val grantType = ResourceOwnerPasswordCredentialsGrant(tokenUrl) + return singletonList(grantType) + } + + @Bean + fun securityContext(): SecurityContext? { + val securityReference = SecurityReference.builder() + .reference("opex") + .scopes(emptyArray()) + .build() + return SecurityContext.builder() + .securityReferences(singletonList(securityReference)) + .operationSelector { + it.requestMappingPattern().matches(Regex("^/(balanceOf|owner)/.*")) + } + .build() + } + + @Bean + fun securityInfo(): SecurityConfiguration? { + return SecurityConfigurationBuilder.builder() + .clientId("admin-cli") + .realm("mixchange") + .appName("opex") + .scopeSeparator(",") + .build() + } } fun main(args: Array) { From 7dd4bd11008d5eac49c5292760fcaa563b14295c Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Tue, 10 Aug 2021 13:58:28 +0430 Subject: [PATCH 3/5] Add description to API swagger doc --- .../kotlin/co/nilin/mixchange/app/ApiApp.kt | 4 + Api/api-ports/api-binance-rest/pom.xml | 5 ++ .../binance/controller/AccountController.kt | 82 ++++++++++++++++++- 3 files changed, 87 insertions(+), 4 deletions(-) diff --git a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt index e869379d3..ef9ec97a8 100644 --- a/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt +++ b/Api/api-app/src/main/kotlin/co/nilin/mixchange/app/ApiApp.kt @@ -4,6 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import org.springframework.security.core.annotation.AuthenticationPrincipal import springfox.documentation.builders.* import springfox.documentation.builders.PathSelectors.regex import springfox.documentation.service.* @@ -13,6 +14,7 @@ import springfox.documentation.spring.web.plugins.Docket import springfox.documentation.swagger.web.SecurityConfiguration import springfox.documentation.swagger.web.SecurityConfigurationBuilder import springfox.documentation.swagger2.annotations.EnableSwagger2 +import java.security.Principal import java.util.Collections.singletonList @@ -38,6 +40,8 @@ class ApiApp { .build() ) ) + .ignoredParameterTypes(AuthenticationPrincipal::class.java, Principal::class.java) + .useDefaultResponseMessages(false) .securitySchemes(singletonList(oauth())) .securityContexts(singletonList(securityContext())) } diff --git a/Api/api-ports/api-binance-rest/pom.xml b/Api/api-ports/api-binance-rest/pom.xml index b0952e230..dde2681c0 100644 --- a/Api/api-ports/api-binance-rest/pom.xml +++ b/Api/api-ports/api-binance-rest/pom.xml @@ -102,6 +102,11 @@ reactor-test test + + io.swagger + swagger-annotations + 1.5.20 + diff --git a/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/controller/AccountController.kt b/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/controller/AccountController.kt index 71f1e5959..fe3171c54 100644 --- a/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/controller/AccountController.kt +++ b/Api/api-ports/api-binance-rest/src/main/kotlin/co/nilin/mixchange/port/api/binance/controller/AccountController.kt @@ -11,15 +11,13 @@ import co.nilin.mixchange.port.api.binance.util.asMatchConstraint import co.nilin.mixchange.port.api.binance.util.asMatchingOrderType import co.nilin.mixchange.port.api.binance.util.asOrderDirection import com.fasterxml.jackson.annotation.JsonInclude +import io.swagger.annotations.* import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map import org.slf4j.LoggerFactory import org.springframework.http.MediaType import org.springframework.security.core.annotation.AuthenticationPrincipal -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import java.math.BigDecimal import java.security.Principal import java.util.* @@ -107,6 +105,16 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ \"symbol\": \"btc_usdt\", \"orderId\": -1, \"orderListId\": -1, \"transactTime\": \"2021-08-03T11:09:23.190+00:00\" }", + mediaType = "application/json" + ) + ) + ) suspend fun createNewOrder( @RequestParam(name = "symbol") symbol: String, @@ -122,16 +130,24 @@ class AccountController( quoteOrderQty: BigDecimal?, @RequestParam(name = "price", required = false) price: BigDecimal?, + @ApiParam( + value = "A unique id among open orders. Automatically generated if not sent.\n" + + "Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected." + ) @RequestParam(name = "newClientOrderId", required = false) newClientOrderId: String?, /* A unique id among open orders. Automatically generated if not sent. Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected. */ + @ApiParam(value = "Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.") @RequestParam(name = "stopPrice", required = false) stopPrice: BigDecimal?, //Used with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders. @RequestParam(name = "icebergQty", required = false) + @ApiParam(value = "Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.") icebergQty: BigDecimal?, //Used with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order. @RequestParam(name = "newOrderRespType", required = false) + @ApiParam(value = "Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK.") newOrderRespType: OrderResponseType?, //Set the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK. + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") @@ -178,6 +194,16 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ \"symbol\": \"btc_usdt\", \"orderId\": 12, \"orderListId\": -1, \"clientOrderId\": \"\", \"price\": 1, \"origQty\": 10, \"executedQty\": 0, \"cummulativeQuoteQty\": 0, \"status\": \"NEW\", \"timeInForce\": \"GTC\", \"type\": \"LIMIT\", \"side\": \"SELL\", \"time\": \"2021-08-04T12:10:13.488+00:00\", \"updateTime\": \"2021-08-04T12:10:13.488+00:00\", \"isWorking\": true, \"origQuoteOrderQty\": 10 }", + mediaType = "application/json" + ) + ) + ) suspend fun queryOrder( principal: Principal, @RequestParam(name = "symbol") @@ -186,6 +212,7 @@ class AccountController( orderId: Long?, @RequestParam(name = "origClientOrderId", required = false) origClientOrderId: String?, + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") @@ -229,10 +256,21 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "[ { \"symbol\": \"btc_usdt\", \"orderId\": 12, \"orderListId\": -1, \"clientOrderId\": \"\", \"price\": 1, \"origQty\": 10, \"executedQty\": 0, \"cummulativeQuoteQty\": 0, \"status\": \"NEW\", \"timeInForce\": \"GTC\", \"type\": \"LIMIT\", \"side\": \"SELL\", \"time\": \"2021-08-04T12:10:13.488+00:00\", \"updateTime\": \"2021-08-04T12:10:13.488+00:00\", \"isWorking\": true, \"origQuoteOrderQty\": 10 } ]", + mediaType = "application/json" + ) + ) + ) suspend fun fetchOpenOrders( principal: Principal, @RequestParam(name = "symbol", required = false) symbol: String?, + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") @@ -273,6 +311,16 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun fetchAllOrders( principal: Principal, @RequestParam(name = "symbol", required = false) @@ -281,8 +329,10 @@ class AccountController( startTime: Date?, @RequestParam(name = "endTime", required = false) endTime: Date?, + @ApiParam(value = "Default 500; max 1000.") @RequestParam(name = "limit", required = false) limit: Int? = 500, //Default 500; max 1000. + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") @@ -324,6 +374,16 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun fetchAllTrades( principal: Principal, @RequestParam(name = "symbol") @@ -332,10 +392,13 @@ class AccountController( startTime: Date?, @RequestParam(name = "endTime", required = false) endTime: Date?, + @ApiParam(value = "TradeId to fetch from. Default gets most recent trades.") @RequestParam(name = "fromId", required = false) fromId: Long?,//TradeId to fetch from. Default gets most recent trades. + @ApiParam(value = "Default 500; max 1000.") @RequestParam(name = "limit", required = false) limit: Int? = 500, //Default 500; max 1000. + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") @@ -357,9 +420,20 @@ class AccountController( consumes = [MediaType.APPLICATION_FORM_URLENCODED_VALUE], produces = [MediaType.APPLICATION_JSON_VALUE] ) + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ \"makerCommission\": 0, \"takerCommission\": 0, \"buyerCommission\": 0, \"sellerCommission\": 0, \"canTrade\": true, \"canWithdraw\": true, \"canDeposit\": true, \"updateTime\": 1628420513843, \"accountType\": \"SPOT\", \"balances\": [ { \"asset\": \"usdt\", \"free\": 1000, \"locked\": 0 } ], \"permissions\": [ \"SPOT\" ] }", + mediaType = "application/json" + ) + ) + ) suspend fun accountInfo( @AuthenticationPrincipal auth: CustomAuthToken, + @ApiParam(value = "The value cannot be greater than 60000") @RequestParam(name = "recvWindow", required = false) recvWindow: Long?, //The value cannot be greater than 60000 @RequestParam(name = "timestamp") From 51b193205523330ddc2a9526d1618b14b20f0df4 Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Tue, 10 Aug 2021 14:22:19 +0430 Subject: [PATCH 4/5] Add description attributes to Wallet and MatchingGateway modules --- .../nilin/mixchange/app/MatchingGatewayApp.kt | 4 ++++ .../app/controller/OrderController.kt | 18 ++++++++++++++- .../nilin/mixchange/wallet/app/WalletApp.kt | 4 ++++ .../app/controller/BalanceController.kt | 13 +++++++++++ .../app/controller/InquiryController.kt | 13 +++++++++++ .../app/controller/TransferController.kt | 13 +++++++++++ .../app/controller/WalletOwnerController.kt | 23 +++++++++++++++++++ 7 files changed, 87 insertions(+), 1 deletion(-) diff --git a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt index 900620766..2563d82a6 100644 --- a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt +++ b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/MatchingGatewayApp.kt @@ -4,6 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import org.springframework.security.core.annotation.AuthenticationPrincipal import springfox.documentation.builders.ApiInfoBuilder import springfox.documentation.builders.OAuthBuilder import springfox.documentation.builders.PathSelectors.regex @@ -14,6 +15,7 @@ import springfox.documentation.spi.service.contexts.SecurityContext import springfox.documentation.spring.web.plugins.Docket import springfox.documentation.swagger.web.SecurityConfiguration import springfox.documentation.swagger.web.SecurityConfigurationBuilder +import java.security.Principal import java.util.* import java.util.Collections.singletonList @@ -38,6 +40,8 @@ class MatchingGatewayApp { .build() ) ) + .ignoredParameterTypes(AuthenticationPrincipal::class.java, Principal::class.java) + .useDefaultResponseMessages(false) .securitySchemes(singletonList(oauth())) .securityContexts(singletonList(securityContext())) } diff --git a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/controller/OrderController.kt b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/controller/OrderController.kt index 8c5d63349..7fb688d60 100644 --- a/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/controller/OrderController.kt +++ b/MatchingGateway/gateway-app/src/main/kotlin/co/nilin/mixchange/app/controller/OrderController.kt @@ -9,6 +9,9 @@ import co.nilin.mixchange.matching.core.model.Pair import co.nilin.mixchange.port.order.kafka.inout.OrderSubmitRequest import co.nilin.mixchange.port.order.kafka.inout.OrderSubmitResult import co.nilin.mixchange.port.order.kafka.service.OrderSubmitter +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.Example +import io.swagger.annotations.ExampleProperty import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody @@ -20,7 +23,20 @@ import java.util.* class OrderController(val orderService: OrderService) { @PostMapping("/order") - suspend fun submitNewOrder(principal: Principal, @RequestBody createOrderRequest: CreateOrderRequest): OrderSubmitResult { + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) + suspend fun submitNewOrder( + principal: Principal, + @RequestBody createOrderRequest: CreateOrderRequest + ): OrderSubmitResult { createOrderRequest.uuid = principal.name return orderService.submitNewOrder(createOrderRequest) } diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt index bbf35740f..914f67242 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/WalletApp.kt @@ -4,6 +4,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication import org.springframework.context.annotation.Bean import org.springframework.context.annotation.ComponentScan +import org.springframework.security.core.annotation.AuthenticationPrincipal import springfox.documentation.builders.ApiInfoBuilder import springfox.documentation.builders.OAuthBuilder import springfox.documentation.builders.PathSelectors.regex @@ -14,6 +15,7 @@ import springfox.documentation.spi.service.contexts.SecurityContext import springfox.documentation.spring.web.plugins.Docket import springfox.documentation.swagger.web.SecurityConfiguration import springfox.documentation.swagger.web.SecurityConfigurationBuilder +import java.security.Principal import java.util.* import java.util.Collections.singletonList @@ -38,6 +40,8 @@ class WalletApp { .build() ) ) + .ignoredParameterTypes(AuthenticationPrincipal::class.java, Principal::class.java) + .useDefaultResponseMessages(false) .securitySchemes(singletonList(oauth())) .securityContexts(singletonList(securityContext())) } diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/BalanceController.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/BalanceController.kt index 4ab005ffc..6549a7738 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/BalanceController.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/BalanceController.kt @@ -2,6 +2,9 @@ package co.nilin.mixchange.wallet.app.controller import co.nilin.mixchange.wallet.core.spi.WalletManager import co.nilin.mixchange.wallet.core.spi.WalletOwnerManager +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.Example +import io.swagger.annotations.ExampleProperty import org.slf4j.LoggerFactory import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable @@ -18,6 +21,16 @@ class BalanceController( data class BalanceResponse(val balance: BigDecimal) @GetMapping("/balanceOf/wallet_type/{wallet_type}/currency/{currency}") + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ \"balance\": 990 }", + mediaType = "application/json" + ) + ) + ) suspend fun getBalance( principal: Principal, @PathVariable("currency") currency: String, diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/InquiryController.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/InquiryController.kt index 97e5b044b..b8ab69a61 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/InquiryController.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/InquiryController.kt @@ -3,6 +3,9 @@ package co.nilin.mixchange.wallet.app.controller import co.nilin.mixchange.wallet.core.model.Amount import co.nilin.mixchange.wallet.core.spi.WalletManager import co.nilin.mixchange.wallet.core.spi.WalletOwnerManager +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.Example +import io.swagger.annotations.ExampleProperty import org.slf4j.LoggerFactory import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable @@ -17,6 +20,16 @@ class InquiryController( data class BooleanResponse(val result: Boolean) @GetMapping("{uuid}/wallet_type/{wallet_type}/can_withdraw/{amount}_{currency}") + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun canFulfill( @PathVariable("uuid") uuid: String, @PathVariable("currency") currency: String, diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/TransferController.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/TransferController.kt index 5da36373b..54ccfaaef 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/TransferController.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/TransferController.kt @@ -6,6 +6,9 @@ import co.nilin.mixchange.wallet.core.model.Amount import co.nilin.mixchange.wallet.core.service.TransferService import co.nilin.mixchange.wallet.core.spi.WalletManager import co.nilin.mixchange.wallet.core.spi.WalletOwnerManager +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.Example +import io.swagger.annotations.ExampleProperty import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RestController @@ -17,6 +20,16 @@ class TransferController( val transferService: TransferService, val walletManager: WalletManager, val walletOwnerManager: WalletOwnerManager ) { @PostMapping("/transfer/{amount}_{symbol}/from/{senderUuid}_{senderWalletType}/to/{receiverUuid}_{receiverWalletType}") + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun transfer( @PathVariable("symbol") symbol: String, @PathVariable("senderWalletType") senderWalletType: String, diff --git a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/WalletOwnerController.kt b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/WalletOwnerController.kt index f4e0f854c..d01d61942 100644 --- a/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/WalletOwnerController.kt +++ b/Wallet/wallet-app/src/main/kotlin/co/nilin/mixchange/wallet/app/controller/WalletOwnerController.kt @@ -2,6 +2,9 @@ package co.nilin.mixchange.wallet.app.controller import co.nilin.mixchange.wallet.core.spi.WalletManager import co.nilin.mixchange.wallet.core.spi.WalletOwnerManager +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.Example +import io.swagger.annotations.ExampleProperty import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RestController import java.math.BigDecimal @@ -26,6 +29,16 @@ class WalletOwnerController( ) @GetMapping("/owner/wallet/all") + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun getAllWallets(principal: Principal): List { val owner = walletOwnerManager.findWalletOwner(principal.name) if (owner != null) { @@ -38,6 +51,16 @@ class WalletOwnerController( } @GetMapping("/owner/limits") + @ApiResponse( + message = "OK", + code = 200, + examples = Example( + ExampleProperty( + value = "{ }", + mediaType = "application/json" + ) + ) + ) suspend fun getWalletOwnerLimits(principal: Principal): OwnerLimitsResponse { val owner = walletOwnerManager.findWalletOwner(principal.name) return if (owner != null) From 185d42b43bced2c18be0a91b64fa81d29507c9fd Mon Sep 17 00:00:00 2001 From: metalicn20 Date: Tue, 10 Aug 2021 15:22:06 +0430 Subject: [PATCH 5/5] Fix corrupted config files --- Deployment/docker-compose.yml | 176 +++++++++--------- .../src/main/resources/application-docker.yml | 4 +- 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/Deployment/docker-compose.yml b/Deployment/docker-compose.yml index 5a07ee778..0dda34600 100644 --- a/Deployment/docker-compose.yml +++ b/Deployment/docker-compose.yml @@ -4,8 +4,8 @@ services: image: 'docker.io/bitnami/zookeeper:3-debian-10' ports: - '127.0.0.1:2181:2181' -# volumes: -# - $PWD/runtime/zookeeper_data:/bitnami + volumes: + - $PWD/runtime/zookeeper_data:/bitnami environment: - ALLOW_ANONYMOUS_LOGIN=yes networks: @@ -17,8 +17,8 @@ services: image: 'docker.io/bitnami/kafka:2-debian-10' ports: - '127.0.0.1:9092:9092' -# volumes: -# - $PWD/runtime/kafka-data:/bitnami + volumes: + - $PWD/runtime/kafka-data:/bitnami environment: - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 - ALLOW_PLAINTEXT_LISTENER=yes @@ -62,30 +62,30 @@ services: deploy: restart_policy: condition: on-failure -# postgres-accountant: -# image: "postgres" -# ports: -# - 127.0.0.1:5433:5432 -# environment: -# - POSTGRES_USER=opex -# - POSTGRES_PASSWORD=hiopex -# - POSTGRES_DB=opex_accountant -# volumes: -# - $PWD/runtime/accountant-data:/var/lib/postgresql/data/ -# networks: -# - opex -# postgres-eventlog: -# image: "postgres" -# ports: -# - 127.0.0.1:5434:5432 -# environment: -# - POSTGRES_USER=opex -# - POSTGRES_PASSWORD=hiopex -# - POSTGRES_DB=opex_eventlog -# volumes: -# - $PWD/runtime/eventlog-data:/var/lib/postgresql/data/ -# networks: -# - opex + postgres-accountant: + image: "postgres" + ports: + - 127.0.0.1:5433:5432 + environment: + - POSTGRES_USER=opex + - POSTGRES_PASSWORD=hiopex + - POSTGRES_DB=opex_accountant + volumes: + - $PWD/runtime/accountant-data:/var/lib/postgresql/data/ + networks: + - opex + postgres-eventlog: + image: "postgres" + ports: + - 127.0.0.1:5434:5432 + environment: + - POSTGRES_USER=opex + - POSTGRES_PASSWORD=hiopex + - POSTGRES_DB=opex_eventlog + volumes: + - $PWD/runtime/eventlog-data:/var/lib/postgresql/data/ + networks: + - opex postgres-auth: image: "postgres" ports: @@ -131,51 +131,51 @@ services: deploy: restart_policy: condition: on-failure -# accountant: -# container_name: accountant -# build: -# context: ../Accountant/accountant-app -# dockerfile: Dockerfile -# ports: -# - 127.0.0.1:8089:8089 -# - 127.0.0.1:1051:1044 -# environment: -# - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 -# - SPRING_PROFILES_ACTIVE=docker -# - KAFKA_IP_PORT=kafka:9092 -# - REDIS_HOST=redis -# - CONSUL_HOST=consul -# - DB_IP_PORT=postgres-accountant -# networks: -# - opex -# depends_on: -# - zookeeper -# - kafka -# - redis -# - consul -# - postgres-accountant -# eventlog: -# container_name: eventlog -# build: -# context: ../EventLog/eventlog-app -# dockerfile: Dockerfile -# ports: -# - 127.0.0.1:8090:8090 -# environment: -# - JAVA_OPTS=-Xmx256m -# - SPRING_PROFILES_ACTIVE=docker -# - KAFKA_IP_PORT=kafka:9092 -# - REDIS_HOST=redis -# - CONSUL_HOST=consul -# - DB_IP_PORT=postgres-eventlog -# networks: -# - opex -# depends_on: -# - zookeeper -# - kafka -# - redis -# - consul -# - postgres-eventlog + accountant: + container_name: accountant + build: + context: ../Accountant/accountant-app + dockerfile: Dockerfile + ports: + - 127.0.0.1:8089:8089 + - 127.0.0.1:1051:1044 + environment: + - JAVA_OPTS=-Xmx256m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 + - SPRING_PROFILES_ACTIVE=docker + - KAFKA_IP_PORT=kafka:9092 + - REDIS_HOST=redis + - CONSUL_HOST=consul + - DB_IP_PORT=postgres-accountant + networks: + - opex + depends_on: + - zookeeper + - kafka + - redis + - consul + - postgres-accountant + eventlog: + container_name: eventlog + build: + context: ../EventLog/eventlog-app + dockerfile: Dockerfile + ports: + - 127.0.0.1:8090:8090 + environment: + - JAVA_OPTS=-Xmx256m + - SPRING_PROFILES_ACTIVE=docker + - KAFKA_IP_PORT=kafka:9092 + - REDIS_HOST=redis + - CONSUL_HOST=consul + - DB_IP_PORT=postgres-eventlog + networks: + - opex + depends_on: + - zookeeper + - kafka + - redis + - consul + - postgres-eventlog matching-engine: container_name: matching-engine build: @@ -295,21 +295,21 @@ services: deploy: restart_policy: condition: on-failure -# nginx: -# image: nginx:latest -# container_name: opex_nginx -# volumes: -# - ./nginx.conf:/etc/nginx/nginx.conf -# - $PWD/runtime/www:/data/www -# ports: -# - 80:80 -# depends_on: -# - wallet -# - auth -# - matching-gateway -# - api -# networks: -# - opex + nginx: + image: nginx:latest + container_name: opex_nginx + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + - $PWD/runtime/www:/data/www + ports: + - 80:80 + depends_on: + - wallet + - auth + - matching-gateway + - api + networks: + - opex networks: opex: driver: bridge \ No newline at end of file diff --git a/UserManagement/keycloak-gateway/src/main/resources/application-docker.yml b/UserManagement/keycloak-gateway/src/main/resources/application-docker.yml index f20892759..0c88c6422 100644 --- a/UserManagement/keycloak-gateway/src/main/resources/application-docker.yml +++ b/UserManagement/keycloak-gateway/src/main/resources/application-docker.yml @@ -11,5 +11,5 @@ spring: keycloak: migration: file: /opex-master-realm.json -# adminUrl: https://api.opex.dev/auth -# frontendUrl: https://api.opex.dev/auth + adminUrl: https://api.opex.dev/auth + frontendUrl: https://api.opex.dev/auth