-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenapi.yaml
198 lines (187 loc) · 4.66 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
openapi: 3.0.3
info:
title: JWT server
description: JWT server for user authentication
version: 1.0.0
servers:
- url: 'https'
paths:
/jwk/rotate:
post:
operationId: "rotateJWK"
tags:
- "jwk"
description: "Rotate the JWK, creating a new key to sign JWTs with."
responses:
200:
description: "Key successfully rotated."
content:
application/json:
schema:
$ref: "#/components/schemas/rotateOKResponse"
500:
description: "Internal server Error"
/jwk:
get:
operationId: "getJWKs"
tags:
- "jwk"
description: "Get all current JWKs for use in validation of tokens."
responses:
200:
description: "Active JWKs"
content:
application/json:
schema:
$ref: "#/components/schemas/jwkResponse"
/jwt/users:
get:
operationId: "getUsers"
tags:
- "jwt"
description: "Get all users"
responses:
200:
description: "UserList"
content:
application/json:
schema:
$ref: "#/components/schemas/usersResponse"
/jwt/signup:
post:
operationId: "signup"
tags:
- "jwt"
description: "Sign up a new user"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/userSignupRequest"
responses:
200:
description: "User successfully signed up"
content:
application/json:
schema:
$ref: "#/components/schemas/userSignupResponse"
/jwt/signin:
post:
operationId: "signin"
tags:
- "jwt"
description: "Sign in an existing user"
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/userSigninRequest"
responses:
200:
description: "User successfully signed in"
content:
application/json:
schema:
$ref: "#/components/schemas/userSigninResponse"
components:
schemas:
rotateOKResponse:
type: object
description: "JWK successfully rotated."
properties:
success:
type: string
example: "OK"
jwkResponse:
type: object
description: "Container for JWKS"
properties:
jwks:
type: array
items:
$ref: "#/components/schemas/jwk"
jwk:
type: object
description: "JWK"
properties:
kid:
type: string
description: "Key id"
example: "d53af85e-27cb-4b4a-9e6a-2f49b35b2da8"
kty:
type: string
description: "Key type"
enum:
- "RSA"
use:
type: string
description: "Use"
enum:
- "sig"
alg:
type: string
description: "Algorithm"
enum:
- "RS512"
mod:
type: string
description: "Modulus"
exp:
type: string
description: "Exponent"
usersResponse:
type: object
properties:
users:
type: array
items:
$ref: "#/components/schemas/user"
user:
type: object
properties:
username:
type: string
description: "The user's login name."
example: "henk"
name:
type: string
description: "The user's full name."
example: "Henk de Vries"
userSignupRequest:
type: object
properties:
username:
type: string
description: "The user's login name."
example: "henk"
name:
type: string
description: "The user's full name."
example: "Henk de Vries"
password:
type: string
description: "The user's password."
example: "!secure-and-safe-123!"
userSignupResponse:
type: string
example: "User signed up successfully"
userSigninRequest:
type: object
properties:
username:
type: string
description: "The user's login name."
example: "henk"
password:
type: string
description: "The user's password."
example: "!secure-and-safe-123!"
userSigninResponse:
type: object
properties:
accessToken:
type: string
description: "JWT access token, base64 encoded"
refreshToken:
type: string
description: "JWT refresh token, base64 encoded"