· 7 years ago · Aug 21, 2018, 07:56 AM
1{
2 "consumes": [
3 "application/x-www-form-urlencoded"
4 ],
5 "produces": [
6 "application/json"
7 ],
8 "schemes": [
9 "http"
10 ],
11 "swagger": "2.0",
12 "info": {
13 "description": "Authorization service",
14 "version": "Latest"
15 },
16 "host": "auth.opentech.local:7575",
17 "basePath": "/api/v1",
18 "paths": {
19 "/clients": {
20 "post": {
21 "description": "Add new client",
22 "consumes": [
23 "application/x-www-form-urlencoded"
24 ],
25 "produces": [
26 "application/json"
27 ],
28 "schemes": [
29 "http"
30 ],
31 "tags": [
32 "clients"
33 ],
34 "operationId": "clientRegister",
35 "parameters": [
36 {
37 "type": "string",
38 "x-go-name": "ClientName",
39 "name": "client_name",
40 "in": "formData",
41 "required": true
42 },
43 {
44 "type": "array",
45 "items": {
46 "type": "string"
47 },
48 "x-go-name": "GrantTypes",
49 "name": "grant_types",
50 "in": "formData",
51 "required": true
52 }
53 ],
54 "responses": {
55 "201": {
56 "$ref": "#/responses/clientResponse"
57 },
58 "default": {
59 "$ref": "#/responses/responseError"
60 }
61 }
62 }
63 },
64 "/clients/{id}": {
65 "put": {
66 "description": "Updates client's data",
67 "consumes": [
68 "application/x-www-form-urlencoded"
69 ],
70 "produces": [
71 "application/json"
72 ],
73 "schemes": [
74 "http"
75 ],
76 "tags": [
77 "clients"
78 ],
79 "operationId": "clientUpdate",
80 "parameters": [
81 {
82 "type": "string",
83 "x-go-name": "ClientID",
84 "name": "client_id",
85 "in": "formData",
86 "required": true
87 },
88 {
89 "type": "string",
90 "x-go-name": "ClientSecret",
91 "name": "client_secret",
92 "in": "formData",
93 "required": true
94 },
95 {
96 "type": "string",
97 "x-go-name": "ID",
98 "name": "id",
99 "in": "path",
100 "required": true
101 },
102 {
103 "type": "string",
104 "x-go-name": "ClientName",
105 "name": "client_name",
106 "in": "formData",
107 "required": true
108 },
109 {
110 "type": "array",
111 "items": {
112 "type": "string"
113 },
114 "x-go-name": "GrantTypes",
115 "name": "grant_types",
116 "in": "formData",
117 "required": true
118 }
119 ],
120 "responses": {
121 "200": {
122 "$ref": "#/responses/clientResponse"
123 },
124 "default": {
125 "$ref": "#/responses/responseError"
126 }
127 }
128 }
129 },
130 "/health/status": {
131 "get": {
132 "description": "This endpoint returns a 200 status Code when the HTTP server is up running",
133 "produces": [
134 "application/json"
135 ],
136 "schemes": [
137 "http"
138 ],
139 "tags": [
140 "health"
141 ],
142 "summary": "Check the Health Status",
143 "operationId": "getStatus",
144 "responses": {
145 "200": {
146 "$ref": "#/responses/statusResponse"
147 },
148 "default": {
149 "$ref": "#/responses/responseError"
150 }
151 }
152 }
153 },
154 "/oauth/introspect": {
155 "post": {
156 "description": "Introspect OAuth2 tokens",
157 "consumes": [
158 "application/x-www-form-urlencoded"
159 ],
160 "produces": [
161 "application/json"
162 ],
163 "schemes": [
164 "http"
165 ],
166 "tags": [
167 "oauth"
168 ],
169 "operationId": "introspectOauthToken",
170 "parameters": [
171 {
172 "type": "string",
173 "x-go-name": "ClientID",
174 "name": "client_id",
175 "in": "formData",
176 "required": true
177 },
178 {
179 "type": "string",
180 "x-go-name": "ClientSecret",
181 "name": "client_secret",
182 "in": "formData",
183 "required": true
184 },
185 {
186 "type": "string",
187 "x-go-name": "Scope",
188 "name": "scope",
189 "in": "formData",
190 "required": true
191 },
192 {
193 "type": "string",
194 "x-go-name": "Token",
195 "name": "token",
196 "in": "formData",
197 "required": true
198 }
199 ],
200 "responses": {
201 "200": {
202 "$ref": "#/responses/introspectResponse"
203 },
204 "default": {
205 "$ref": "#/responses/responseError"
206 }
207 }
208 }
209 },
210 "/oauth/revoke": {
211 "post": {
212 "description": "Revoking a access token",
213 "consumes": [
214 "application/x-www-form-urlencoded"
215 ],
216 "produces": [
217 "application/json"
218 ],
219 "schemes": [
220 "http"
221 ],
222 "tags": [
223 "oauth"
224 ],
225 "operationId": "revokeOauthToken",
226 "parameters": [
227 {
228 "type": "string",
229 "x-go-name": "ClientID",
230 "name": "client_id",
231 "in": "formData",
232 "required": true
233 },
234 {
235 "type": "string",
236 "x-go-name": "ClientSecret",
237 "name": "client_secret",
238 "in": "formData",
239 "required": true
240 },
241 {
242 "type": "string",
243 "x-go-name": "Token",
244 "name": "token",
245 "in": "formData",
246 "required": true
247 }
248 ],
249 "responses": {
250 "204": {
251 "$ref": "#/responses/emptyResponse"
252 },
253 "default": {
254 "$ref": "#/responses/responseError"
255 }
256 }
257 }
258 },
259 "/oauth/token": {
260 "post": {
261 "description": "Oauth2 specification endpoint. RFC4.3",
262 "consumes": [
263 "application/x-www-form-urlencoded"
264 ],
265 "produces": [
266 "application/json"
267 ],
268 "schemes": [
269 "http"
270 ],
271 "tags": [
272 "oauth"
273 ],
274 "summary": "Oauth2 specification endpoint",
275 "operationId": "getOauthToken",
276 "parameters": [
277 {
278 "type": "string",
279 "x-go-name": "ClientID",
280 "name": "client_id",
281 "in": "formData",
282 "required": true
283 },
284 {
285 "type": "string",
286 "x-go-name": "ClientSecret",
287 "name": "client_secret",
288 "in": "formData",
289 "required": true
290 },
291 {
292 "type": "string",
293 "x-go-name": "Scope",
294 "name": "scope",
295 "in": "formData",
296 "required": true
297 },
298 {
299 "type": "string",
300 "x-go-name": "GrantType",
301 "name": "grant_type",
302 "in": "formData",
303 "required": true
304 },
305 {
306 "type": "string",
307 "x-go-name": "Username",
308 "name": "username",
309 "in": "formData"
310 },
311 {
312 "type": "string",
313 "x-go-name": "Password",
314 "name": "password",
315 "in": "formData"
316 },
317 {
318 "type": "string",
319 "x-go-name": "RefreshToken",
320 "name": "refresh_token",
321 "in": "formData"
322 }
323 ],
324 "responses": {
325 "200": {
326 "$ref": "#/responses/tokenResponse"
327 },
328 "default": {
329 "$ref": "#/responses/responseError"
330 }
331 }
332 }
333 }
334 },
335 "responses": {
336 "clientResponse": {
337 "schema": {
338 "type": "object",
339 "properties": {
340 "client_id": {
341 "type": "integer",
342 "format": "int64",
343 "x-go-name": "ID"
344 },
345 "client_name": {
346 "type": "string",
347 "x-go-name": "Name"
348 },
349 "client_secret": {
350 "type": "string",
351 "x-go-name": "Secret"
352 },
353 "grant_types": {
354 "type": "array",
355 "items": {
356 "type": "string"
357 },
358 "x-go-name": "GrantTypes"
359 },
360 "registered_at": {
361 "type": "string",
362 "format": "date-time",
363 "x-go-name": "RegisteredAt"
364 }
365 }
366 }
367 },
368 "emptyResponse": {},
369 "introspectResponse": {
370 "schema": {
371 "type": "object",
372 "properties": {
373 "active": {
374 "type": "boolean",
375 "x-go-name": "Active"
376 }
377 }
378 }
379 },
380 "responseError": {
381 "schema": {
382 "type": "object",
383 "properties": {
384 "error": {
385 "type": "string",
386 "x-go-name": "Name"
387 },
388 "error_description": {
389 "type": "string",
390 "x-go-name": "Description"
391 }
392 }
393 }
394 },
395 "statusResponse": {
396 "schema": {
397 "type": "object",
398 "properties": {
399 "status": {
400 "type": "string",
401 "x-go-name": "Status"
402 }
403 }
404 }
405 },
406 "tokenResponse": {
407 "schema": {
408 "type": "object",
409 "properties": {
410 "access_token": {
411 "type": "string",
412 "x-go-name": "AccessToken"
413 },
414 "refresh_token": {
415 "type": "string",
416 "x-go-name": "RefreshToken"
417 }
418 }
419 }
420 }
421 },
422 "securityDefinitions": {
423 "basic": {
424 "type": "basic"
425 }
426 },
427 "x-forwarded-proto": "string",
428 "x-request-id": "string"
429}