我使用Cloud Endpoint的版本控制功能(即gcloud service-management deploy openapi_v1.yaml openapi_v2.yaml
)将2个版本的openapi.yaml文件部署到了Google Cloud Endpoint。 yaml文件的每个版本都包含不同于另一版本的版本号和基本路径,一个使用api-key认证的端点以及api-key认证标签的定义。在部署到Endpoint后,配置将显示yaml文件,但使用此配置将api部署到GAE只会为新版本启用api-key身份验证。如何在将多个版本部署到Google Clould Endpoint中的相同配置时为所有版本启用api-key auth
有谁知道这是一个已知的错误,还是有其他事情我需要做以启用所有版本的身份验证?
.yaml文件如下所示。我用来测试上的两个版本,除了版本和bathpath相同:
swagger: "2.0"
info:
description: "This API is used to connect 3rd-party ids to a common user identity"
version: "0.0.1"
title: "****"
host: "uie-dot-user-id-exchange.appspot.com"
basePath: "/v0"
...
- "https"
x-google-allow: all
paths:
...
/ids/search:
get:
operationId: "id_search"
produces:
- "application/json"
security:
- api_key: []
tags:
- "Ids"
summary: "Privileged endpoint. Provide any id (3rd party or otherwise) and get a hash of all ids associated with it."
parameters:
- in: "query"
name: "id_type"
description: "Type of id to search"
required: true
type: string
- in: "query"
name: "id_value"
description: "Value of id to search"
required: true
type: string
responses:
200:
description: "AssociatedIdsHash"
schema:
$ref: '#/definitions/AssociatedIdsHash'
400:
description: "Bad request. Requires both id_type and id_value query parameters."
401:
description: "Unauthorized. Please provide a valid api-key in the \"api-key\" header."
404:
description: "Not found - no entry found for key provided"
...
################ SECURITY DEFINITIONS ################
securityDefinitions:
# This section configures basic authentication with an API key.
api_key:
type: "apiKey"
name: "key"
in: "query"
你可以发布你的yaml文件吗? –