1

Cloud Endpointのバージョン管理機能(つまりgcloud service-management deploy openapi_v1.yaml openapi_v2.yaml)を使用して2つのバージョンのopenapi.yamlファイルをGoogle Cloud Endpointに導入しました。 yamlファイルの各バージョンには、バージョン番号と、別のものと異なる基本パス、api-key認証を使用する1つのエンドポイント、api-key認証タグの定義が含まれています。エンドポイントにデプロイした後、設定では両方のyamlファイルが表示されますが、この設定を使用してGAEにapiをデプロイすると、新しいバージョンのAPIキー認証のみが有効になります。複数のバージョンをGoogle Clouldエンドポイントで同じ設定に展開する際に、すべてのバージョンでapi-key authを有効にする方法

これは既知のバグか、すべてのバージョンの認証を有効にするために何か必要なことは誰にも分かりますか?

.yamlファイルは次のようになります。

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" 
+0

yamlファイルを投稿できますか? –

答えて

0

が、私はこの問題を複製することができ、バグのように見える:私がテストするために使用される2つのバージョンがバージョンとbathpath除いて同一です。

パス単位のレベルではなく、両方のバージョンのグローバルレベルでAPIキーの制限を追加するとどのような効果がありますか。おそらく、この回避策はあなたのユースケースで十分でしょう。

... 
security: 
- api_key: [] 
path: 
... 
+0

確認していただきありがとうございます。これが修正される予定のタイムラインはありますか?プロジェクトでは、パス単位のレベルでapi_key authを有効にする必要があります。 –

+0

修正のタイムラインはありませんが、バグが記録され、追跡されています。 –

関連する問題