-
Notifications
You must be signed in to change notification settings - Fork 0
/
user-auth-spec.yml
128 lines (128 loc) · 3.45 KB
/
user-auth-spec.yml
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
openapi: 3.0.1
info:
title: Authentication
description: User Authentication specification to define the user log into API
contact:
email: [email protected]
version: 1.0.0
servers:
- url: https://localhost:8080/v1
description: Production server
tags:
- name: auth
description: User Authentication
paths:
/login:
post:
summary: Authentication of the user
tags:
- auth
operationId: loginUser
requestBody:
$ref: '#/components/requestBody/userBody'
responses:
200:
$ref: '#/components/responses/Success'
400:
$ref: '#/components/responses/BadRequest'
404:
$ref: '#/components/responses/NotFound'
500:
$ref: '#/components/responses/ServerError'
components:
schemas:
requestBody:
required:
- email
- password
type: object
properties:
email:
type: string
format: email
pattern: '^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
minimum: 10
example: [email protected]
password:
minimum: 1
type: string
format: password
example: '123'
tokenBody:
required:
- scope
- expires_in
- refresh_token
- access_token
- developer.email
type: object
properties:
scope:
type: string
minimum: 1
example: read, write
expires_in:
type: integer
format: int64
example: 3600000
refresh_token:
type: string
format: byte
minimum: 1
example: rVSmm3QaNa0xBVFbUISz1NZI15akvgLJ
access_token:
type: string
format: byte
minimum: 1
example: AnoHsh2oZ6EFWF4h0KrA0gC5og3a
developer.email:
type: string
format: email
minimum: 1
example: [email protected]
body_response_error:
required:
- code_error
- message
type: object
properties:
code_error:
type: integer
format: int64
minimum: 1
example: 13216
message:
type: string
example: message_to_show
requestBody:
userBody:
description: User JSON object required
content:
application/json:
schema:
$ref: '#/components/schemas/requestBody'
responses:
Success:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/tokenBody'
BadRequest:
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/body_response_error'
ServerError:
description: Server error
content:
application/json:
schema:
$ref: '#/components/schemas/body_response_error'
NotFound:
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/body_response_error'