Skip to content

Commit 3054644

Browse files
buserpbshaffer
authored andcommitted
Add openapi-appengine.yaml file for App Engine deployments. (GoogleCloudPlatform#407)
1 parent 68ca48f commit 3054644

File tree

2 files changed

+107
-3
lines changed

2 files changed

+107
-3
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# [START swagger]
2+
swagger: "2.0"
3+
info:
4+
description: "A simple Google Cloud Endpoints API example."
5+
title: "Endpoints Example"
6+
version: "1.0.0"
7+
host: "YOUR-PROJECT-ID.appspot.com"
8+
# [END swagger]
9+
basePath: "/"
10+
consumes:
11+
- "application/json"
12+
produces:
13+
- "application/json"
14+
schemes:
15+
- "https"
16+
paths:
17+
"/echo":
18+
post:
19+
description: "Echo back a given message."
20+
operationId: "echo"
21+
produces:
22+
- "application/json"
23+
responses:
24+
200:
25+
description: "Echo"
26+
schema:
27+
$ref: "#/definitions/echoMessage"
28+
parameters:
29+
- description: "Message to echo"
30+
in: body
31+
name: message
32+
required: true
33+
schema:
34+
$ref: "#/definitions/echoMessage"
35+
security:
36+
- api_key: []
37+
"/auth/info/googlejwt":
38+
get:
39+
description: "Returns the requests' authentication information."
40+
operationId: "auth_info_google_jwt"
41+
produces:
42+
- "application/json"
43+
responses:
44+
200:
45+
description: "Authenication info."
46+
schema:
47+
$ref: "#/definitions/authInfoResponse"
48+
security:
49+
- google_jwt: []
50+
"/auth/info/googleidtoken":
51+
get:
52+
description: "Returns the requests' authentication information."
53+
operationId: "authInfoGoogleIdToken"
54+
produces:
55+
- "application/json"
56+
responses:
57+
200:
58+
description: "Authenication info."
59+
schema:
60+
$ref: "#/definitions/authInfoResponse"
61+
security:
62+
- google_id_token: []
63+
64+
definitions:
65+
echoMessage:
66+
properties:
67+
message:
68+
type: "string"
69+
authInfoResponse:
70+
properties:
71+
id:
72+
type: "string"
73+
email:
74+
type: "string"
75+
76+
securityDefinitions:
77+
# This section configures basic authentication with an API key.
78+
api_key:
79+
type: "apiKey"
80+
name: "key"
81+
in: "query"
82+
# This section configures authentication using Google API Service Accounts
83+
# to sign a json web token. This is mostly used for server-to-server
84+
# communication.
85+
google_jwt:
86+
authorizationUrl: ""
87+
flow: "implicit"
88+
type: "oauth2"
89+
# This must match the 'iss' field in the JWT.
90+
x-google-issuer: "jwt-client.endpoints.sample.google.com"
91+
# Update this with your service account's email address.
92+
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/jwk/YOUR-SERVICE-ACCOUNT-EMAIL"
93+
# This must match the "aud" field in the JWT. You can add multiple
94+
# audiences to accept JWTs from multiple clients.
95+
x-google-audiences: "echo.endpoints.sample.google.com"
96+
# This section configures authentication using Google OAuth2 ID Tokens.
97+
# ID Tokens can be obtained using OAuth2 clients, and can be used to access
98+
# your API on behalf of a particular user.
99+
google_id_token:
100+
authorizationUrl: ""
101+
flow: "implicit"
102+
type: "oauth2"
103+
x-google-issuer: "https://accounts.google.com"
104+
x-google-jwks_uri: "https://www.googleapis.com/oauth2/v3/certs"
105+
# Your OAuth2 client's Client ID must be added here. You can add
106+
# multiple client IDs to accept tokens from multiple clients.
107+
x-google-audiences: "YOUR-CLIENT-ID"

endpoints/getting-started/openapi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ info:
66
version: "1.0.0"
77
host: "echo-api.endpoints.YOUR-PROJECT-ID.cloud.goog"
88
# [END swagger]
9-
# For App Engine deployments, delete the above "host:" line and uncomment
10-
# the following line.
11-
# host: "YOUR-PROJECT-ID.appspot.com"
129
basePath: "/"
1310
consumes:
1411
- "application/json"

0 commit comments

Comments
 (0)