-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
94 lines (94 loc) · 2.36 KB
/
swagger.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
definitions:
models.Request:
properties:
email:
example: to@example.com
type: string
guid:
example: 1
type: integer
required:
- email
- guid
type: object
models.Response:
properties:
access_token:
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
type: string
refresh_token:
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
type: string
required:
- access_token
- refresh_token
type: object
info:
contact: {}
description: This is a sample server for getting and refreshing access and refresh
JWT tokens
title: Go Authentication JWT
version: "1.0"
servers:
- url: "http://localhost:8080"
description: "Main API server"
paths:
/create:
post:
consumes:
- application/json
description: Create access and refresh tokens by user's GUID and E-Mail
parameters:
- description: JSON with GUID and E-Mail
in: body
name: data
required: true
schema:
$ref: '#/definitions/models.Request'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Response'
"400":
description: Bad Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
summary: Create tokens
tags:
- tokens
/refresh:
get:
description: Refresh access and refresh tokens by refresh token
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/models.Response'
"400":
description: Bad Request
schema:
type: string
"500":
description: Internal Server Error
schema:
type: string
security:
- X-Refresh-Token: []
summary: Refresh tokens
tags:
- tokens
securityDefinitions:
X-Refresh-Token:
in: header
name: X-Refresh-Token
type: apiKey
swagger: "2.0"