Product-apim: 改进 OAS 定义以支持 Micro GW

创建于 2019-10-07  ·  11评论  ·  资料来源: wso2/product-apim

目前,OAS 定义支持以下自定义属性。 如果有什么需要改进的,请查看并提出建议。

x-wso2-auth-header: "Authorization"
x-throttling-tier: "Unlimited"
x-wso2-cors:
corsConfigurationEnabled: false
accessControlAllowOrigins:
- "*"
accessControlAllowCredentials: false
accessControlAllowHeaders:
- "authorization"
- "Access-Control-Allow-Origin"
- "Content-Type"
- "SOAPAction"
accessControlAllowMethods:
- "GET"
- "PUT"
- "POST"
- "DELETE"
- "PATCH"
- "OPTIONS"
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-basePath: "/sample/1.0.0"
x-wso2-transports:
- "http"
- "https"

对于每种端点类型,其配置如下。

HTTP
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"

HTTP 故障转移
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"

HTTP 负载均衡
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "load_balance"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "load_balance"

肥皂
x-wso2-production-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
x-wso2-sandbox-endpoints:
url: "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"

SOAP 故障转移
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "failover"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "failover"

SOAP 负载平衡
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "load_balance"
x-wso2-sandbox-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "address"
endpoint_config: "load_balance"

默认端点
x-wso2-production-endpoints:
endpoint_type: "default"
x-wso2-sandbox-endpoints:
endpoint_type: "default"

所有11条评论

我们可以改变
端点类型:“http”-> 类型:“http”

需要x-wso2-disable-security来禁用资源的安全性https://github.com/wso2/product-microgateway#microgateway -supported-open-api-extensions

需要改变
网址 -> 网址

x-throttling-tier:“无限”
这应该是 x-wso2-throttling-tier

无论是否是单个端点,它都必须是一个数组。
网址:“https://localhost:9443/publisher/apis/create/rest”->
网址:

HTTP failover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
endpoint_type: "http"
endpoint_config: "failover"

需要改为

HTTP failover
x-wso2-production-endpoints:
url:
- "https://localhost:9443/publisher/apis/create/rest"
- "https://localhost:9443/publisher/apis/create/rest"
type: "failover"

负载平衡端点也是如此

需要x-wso2-disable-security来禁用资源的安全性https://github.com/wso2/product-microgateway#microgateway -supported-open-api-extensions

@praminda此信息已经以“x-auth-type”的名称存在。我们可以重用它吗?

x-throttling-tier:“无限”
这应该是 x-wso2-throttling-tier

@hasuniea此信息已存在,名称为“x-throttling-tier”。 我们可以重审吗? 否则会在swagger中出现重复信息。

x 节流层

现在微网关支持x-throttling-tier,因此它是数据的重复,我认为我们可以保持原样

x-auth-type

是的,我们可以使用这个扩展,因为我们在 MGW 支持它

此问题已修复。 因此关闭。

此页面是否有帮助?
0 / 5 - 0 等级