Skip to content

Commit c1e7e4a

Browse files
buserpjmdobry
authored andcommitted
Create openapi-appengine.yaml (#376)
1 parent 599e429 commit c1e7e4a

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
"/auth/info/googlejwt":
36+
get:
37+
description: "Returns the requests' authentication information."
38+
operationId: "auth_info_google_jwt"
39+
produces:
40+
- "application/json"
41+
responses:
42+
200:
43+
description: "Authenication info."
44+
schema:
45+
$ref: "#/definitions/authInfoResponse"
46+
security:
47+
- google_jwt: []
48+
"/auth/info/googleidtoken":
49+
get:
50+
description: "Returns the requests' authentication information."
51+
operationId: "authInfoGoogleIdToken"
52+
produces:
53+
- "application/json"
54+
responses:
55+
200:
56+
description: "Authenication info."
57+
schema:
58+
$ref: "#/definitions/authInfoResponse"
59+
security:
60+
- google_id_token: []
61+
definitions:
62+
echoMessage:
63+
properties:
64+
message:
65+
type: "string"
66+
authInfoResponse:
67+
properties:
68+
id:
69+
type: "string"
70+
email:
71+
type: "string"
72+
# This section requires all requests to any path to require an API key.
73+
security:
74+
- api_key: []
75+
securityDefinitions:
76+
# This section configures basic authentication with an API key.
77+
api_key:
78+
type: "apiKey"
79+
name: "key"
80+
in: "query"
81+
# This section configures authentication using Google API Service Accounts
82+
# to sign a json web token. This is mostly used for server-to-server
83+
# communication.
84+
google_jwt:
85+
authorizationUrl: ""
86+
flow: "implicit"
87+
type: "oauth2"
88+
# This must match the 'iss' field in the JWT.
89+
x-google-issuer: "jwt-client.endpoints.sample.google.com"
90+
# Update this with your service account's email address.
91+
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/jwk/YOUR-SERVICE-ACCOUNT-EMAIL"
92+
# This must match the "aud" field in the JWT. You can add multiple
93+
# audiences to accept JWTs from multiple clients.
94+
x-google-audiences: "echo.endpoints.sample.google.com"
95+
# This section configures authentication using Google OAuth2 ID Tokens.
96+
# ID Tokens can be obtained using OAuth2 clients, and can be used to access
97+
# your API on behalf of a particular user.
98+
google_id_token:
99+
authorizationUrl: ""
100+
flow: "implicit"
101+
type: "oauth2"
102+
x-google-issuer: "https://accounts.google.com"
103+
x-google-jwks_uri: "https://www.googleapis.com/oauth2/v3/certs"
104+
# Your OAuth2 client's Client ID must be added here. You can add
105+
# multiple client IDs to accept tokens from multiple clients.
106+
x-google-audiences: "YOUR-CLIENT-ID"

0 commit comments

Comments
 (0)