{"owner":"GoogleCloudPlatform","repo":"golang-samples","hasSpec":true,"specFile":"endpoints/getting-started/openapi-appengine.yaml","branch":"HEAD","format":"yaml","version":"2.0 (YAML)","title":"golang-samples","description":"","endpoints":[],"spec":"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# [START endpoints_swagger_appengine_yaml_go]\nswagger: \"2.0\"\ninfo:\n  description: \"A simple Google Cloud Endpoints API example.\"\n  title: \"Endpoints Example\"\n  version: \"1.0.0\"\nhost: \"YOUR-PROJECT-ID.appspot.com\"\n# [END endpoints_swagger_appengine_yaml_go]\nconsumes:\n- \"application/json\"\nproduces:\n- \"application/json\"\nschemes:\n- \"https\"\npaths:\n  \"/echo\":\n    post:\n      description: \"Echo back a given message.\"\n      operationId: \"echo\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"Echo\"\n          schema:\n            $ref: \"#/definitions/echoMessage\"\n      parameters:\n      - description: \"Message to echo\"\n        in: body\n        name: message\n        required: true\n        schema:\n          $ref: \"#/definitions/echoMessage\"\n      security:\n      - api_key: []\n  \"/auth/info/googlejwt\":\n    get:\n      description: \"Returns the requests' authentication information.\"\n      operationId: \"auth_info_google_jwt\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"Authentication info.\"\n          schema:\n            $ref: \"#/definitions/authInfoResponse\"\n      security:\n      - google_jwt: []\n  \"/auth/info/googleidtoken\":\n    get:\n      description: \"Returns the requests' authentication information.\"\n      operationId: \"authInfoGoogleIdToken\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"Authentication info.\"\n          schema:\n            $ref: \"#/definitions/authInfoResponse\"\n      security:\n      - google_id_token: []\n  \"/auth/info/firebase\":\n    get:\n      description: \"Returns the requests' authentication information.\"\n      operationId: \"authInfoFirebase\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"Authentication info.\"\n          schema:\n            $ref: \"#/definitions/authInfoResponse\"\n      security:\n      - firebase: []\n  \"/auth/info/auth0\":\n    get:\n      description: \"Returns the requests' authentication information.\"\n      operationId: \"auth_info_auth0_jwk\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"Authentication info.\"\n          schema:\n            $ref: \"#/definitions/authInfoResponse\"\n      security:\n      - auth0_jwk: []\ndefinitions:\n  echoMessage:\n    type: \"object\"\n    properties:\n      message:\n        type: \"string\"\n  authInfoResponse:\n    properties:\n      id:\n        type: \"string\"\n      email:\n        type: \"string\"\n# This section requires all requests to any path to require an API key.\nsecurityDefinitions:\n  # This section configures basic authentication with an API key.\n  api_key:\n    type: \"apiKey\"\n    name: \"key\"\n    in: \"query\"\n  # This section configures authentication using Google API Service Accounts\n  # to sign a json web token. This is mostly used for server-to-server\n  # communication.\n  google_jwt:\n    authorizationUrl: \"\"\n    flow: \"implicit\"\n    type: \"oauth2\"\n    # This must match the 'iss' field in the JWT.\n    x-google-issuer: \"jwt-client.endpoints.sample.google.com\"\n    # Update this with your service account's email address.\n    x-google-jwks_uri: \"https://www.googleapis.com/service_accounts/v1/jwk/YOUR-SERVICE-ACCOUNT-EMAIL\"\n    # This must match the \"aud\" field in the JWT. You can add multiple audiences to accept JWTs from multiple clients.\n    x-google-audiences: \"echo.endpoints.sample.google.com\"\n  # This section configures authentication using Google OAuth2 ID Tokens.\n  # ID Tokens can be obtained using OAuth2 clients, and can be used to access\n  # your API on behalf of a particular user.\n  google_id_token:\n    authorizationUrl: \"\"\n    flow: \"implicit\"\n    type: \"oauth2\"\n    x-google-issuer: \"https://accounts.google.com\"\n    x-google-jwks_uri: \"https://www.googleapis.com/oauth2/v3/certs\"\n    x-google-audiences: \"YOUR-CLIENT-ID\"\n  # This section configures authentication using Firebase Auth.\n  firebase:\n    authorizationUrl: \"\"\n    flow: \"implicit\"\n    type: \"oauth2\"\n    x-google-issuer: \"https://securetoken.google.com/YOUR-PROJECT-ID\"\n    x-google-jwks_uri: \"https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com\"\n    x-google-audiences: \"YOUR-PROJECT-ID\"\n      # This section configures authentication using Auth0 (https://auth0.com).\n  auth0_jwk:\n    # Update YOUR-ACCOUNT-NAME with your Auth0 account name.\n    authorizationUrl: \"https://YOUR-ACCOUNT-NAME.auth0.com/authorize\"\n    flow: \"implicit\"\n    type: \"oauth2\"\n    x-google-issuer: \"https://YOUR-ACCOUNT-NAME.auth0.com/\"\n    # Update this with your service account's email address.\n    x-google-jwks_uri: \"https://YOUR-ACCOUNT-NAME.auth0.com/.well-known/jwks.json\"\n    # Replace with your client ID, found in the Auth0 console.\n    x-google-audiences: \"YOUR-CLIENT-ID\"\n"}