WSO2 API管理器屏蔽服务

时间:2020-02-10 16:21:42

标签: wso2 wso2-am

是否可能在API Manager中的服务中生成了掩码?类似于:

API的原始服务:

http://API/v1/profile
http://API/v1/account

带面具:

http://API/v1/user-profile
http://API/v1/user-account

我的想法是:

  1. 发布者页面->运行时配置中,添加一个消息中介,该消息中介使用掩码删除了该服务的 user-

  2. API定义发布者页面中,在服务中放置一些掩码的JSON Swagger 。这是Swagger中的 TAG 的示例:

 tags: 
   - "/v1/kyc-perfil"

Example With TAG

API管理器中的服务是否可以生成掩码?

编辑: 阅读Bee的答案后,可在两个或多个服务中工作,而每个服务中的请求与服务原件相同且不同。

我试图将类似的内容放进去:

    <property name="/v1/kyc-{DYNAMIC-PARAMETER}" expression="get-property('axis2', 'REST_URL_POSTFIX')"/>
    <property name="REST_URL_POSTFIX" value="/v1/{DYNAMIC-PARAMETER}" scope="axis2"/>

1 个答案:

答案 0 :(得分:1)

您可以执行选项1。使用REST_URL_POSTFIX属性。试试这个。

阅读: <property name="post_fix" expression="get-property('axis2', 'REST_URL_POSTFIX')"/>

写: <property name="REST_URL_POSTFIX" value="new_post_fix" scope="axis2"/>

参考:https://docs.wso2.com/display/ESB470/HTTP+Transport+Properties#HTTPTransportProperties-Property:REST_URL_POSTFIXREST_URL_POSTFIX