-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
189 lines (189 loc) · 5.26 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
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
openapi: 3.0.1
info:
title: Authorization-Authentication-Golang
description: An API documentation for organization-user JWT authentication system. Made using golang, gin, gorm and go-jwt.
version: "0.1"
servers:
- url: http://localhost:3000
components:
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: Authorization
paths:
/removeMember:
post:
security:
- cookieAuth: []
description: Remove the member from an organization provided the current user is an admin of the organization.
requestBody:
content:
application/json:
schema:
type: object
properties:
user_id:
type: integer
organization_id:
type: integer
examples:
"0":
value: |-
{
"user_id": 21,
"organization_id": 1
}
responses:
"200":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000
/login:
post:
description: The current user is logged in, provided the correct username and password is passed.
requestBody:
content:
application/json:
schema:
type: object
properties:
password:
type: string
username:
type: string
examples:
"0":
value: |-
{
"username": "testorg3user",
"password": "password"
}
responses:
"200":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000
/logout:
get:
security:
- cookieAuth: []
description: The current user is logged out.
responses:
"200":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000
/createOrganization:
post:
security:
- cookieAuth: []
description: Creates an organization and makes the creator of the organization an admin of the organization.
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
examples:
"0":
value: |-
{
"name": "swagger-testing"
}
responses:
"201":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000
/getUsersFromOrganization/{organizationID}:
get:
security:
- cookieAuth: []
description: Get members of an organization provided the current user is also a member
parameters:
- in: path
name: organizationID
schema:
type: integer
required: true
description: Numeric ID of the organization to get members from
responses:
"200":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000
/createUser:
post:
security:
- cookieAuth: []
description: Creates a new user for an organization provided that the current user is an admin of the organization.
requestBody:
content:
application/json:
schema:
type: object
properties:
password:
type: string
organization_id:
type: integer
username:
type: string
examples:
"0":
value: |-
{
"username": "testUser5",
"password": "password",
"organization_id": 1
}
responses:
"201":
description: Auto generated using Swagger Inspector
content:
application/json; charset=utf-8:
schema:
type: string
examples: {}
servers:
- url: http://localhost:3000
servers:
- url: http://localhost:3000