Adding [email protected] On Fri, Feb 22, 2019 at 11:08 AM Amali Matharaarachchi <[email protected]> wrote:
> Hi all, > > I am working on reducing coupling between APIM and Microgateway[1]. > > > *Problem*: > > Microgateway requires the same version of the API Manager to be executed. > > > *Description*: > > API Manager uses URI versioning for its REST API. Microgateway uses this > REST API, so it needs to consider the version. Microgateway is coupled with > its same version of API Manager due to a declaration of these REST URLs as > constants. See below example. > > > *Example*: > > > * API Manager 2.5.0 > > version - 0.13.0 > > * API Manager 2.6.0 > > version - 0.14.0 > > > Microgateway 2.6.0 cannot be executed with API Manager 2.5.0 because > Microgateway 2.6.0 has below REST service constants in > "/product-microgateway/components/micro-gateway-cli/src/main/java/org/wso2/apimgt/gateway/cli/constants/RESTServiceConstants.java > > > public static final String PUB_RESOURCE_PATH = "/api/am/publisher/v0.14"; > > public static final String PUB_CLIENT_CERT_PATH = > "/api/am/publisher/v0.14/clientCertificates"; > > public static final String ADMIN_RESOURCE_PATH = "/api/am/admin/v0.14"; > > public static final String DCR_RESOURCE_PATH = > "/client-registration/v0.14/register"; > > > which are bounded to API Manager 2.6.0 > > > *Solution*: > > Furthermore, there is a toolkit-config.toml file to setup configurations. > We can avoid above constants by specifying these URLs as below in that file. > > > > publisherEndpoint = "https://localhost:9443/api/am/publisher/v0.13" > > adminEndpoint = "https://localhost:9443/api/am/admin/v0.13" > > registrationEndpoint = " > https://localhost:9443/client-registration/v0.13/register" > > tokenEndpoint = "https://localhost:9443/oauth2/token" > > > So a user can specify REST API version manually. > > > *Suggested improvement:* > > Instead of specifying REST API version and these endpoints, allow the user > to only add the API Manager version. The configuration file will include > fields similar to the following. > > apimVersion = “2.5.0” > > publisherEndpoint = "https://localhost:9443/api/am/publisher/" > > adminEndpoint = "https://localhost:9443/api/am/admin/" > > registrationEndpoint = " > https://localhost:9443/client-registration/{version}/register" > > tokenEndpoint = "https://localhost:9443/oauth2/token" > > > *Implementation:* > > In order to implement as above, we need to recognize the REST API version > which corresponds to the API Manager version. Following approaches are > identified; > > > 1. Get the version of the REST API of the specific API Manager version by > using the API Manager’s swagger definition. However, an endpoint to access > swagger definition is not provided in API Manager 2.x > > 2. Profile REST API version for each API Manager version in Microgateway. > (Drawback of this approach is that, Microgateway will only provide backward > compatibility(compatible only to past API Manager versions) because new > versions of API Manager which are released later may not be included yet in > version profiling.) > > > Among them, the second option is selected. Version profiling in > Microgateway is more suited considering time constraints and simplicity. > > > I would really appreciate your feedback. Thank you. > > > *Reference:* > > [1] https://github.com/wso2/product-microgateway/issues/301 > -- *Amali Lakshika* *Software EngineerWSO2 Inc.: https://wso2.com <http://wso2.com/>lean.enterprise.middle-waremobile: **+94 71 932 1861* *skype: amali.94d* <http://wso2.com/signature>
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
