-
Notifications
You must be signed in to change notification settings - Fork 1
/
AnSu-IAM.yaml
211 lines (211 loc) · 5.23 KB
/
AnSu-IAM.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
199
200
201
202
203
204
205
206
207
208
209
210
211
swagger: '2.0'
info:
description: >-
AnSu-IAM is a IAM (Identity and Authorisation Management) service that can
be used for token based authentication.
version: 1.0.0
title: AnSu-IAM
host: 35.154.174.148
basePath: /ansu-iam
tags:
- name: application
description: Application management
- name: user
description: User management
- name: token
description: Token management
schemes:
- http
paths:
/app/:
get:
tags:
- application
summary: Get the application's appId
description: ''
produces:
- application/json
parameters:
- in: query
name: appName
description: Name of the application
required: true
type: string
responses:
default:
description: Check payload for appropriate response
/app/create:
post:
tags:
- application
summary: Register a new application
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: appName
description: Name of the application to be registered
required: true
type: string
responses:
default:
description: Check payload for appropriate response
/app/update:
put:
tags:
- application
summary: Update application's token life time (in seconds)
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: appId
description: Application ID (see GET /app/)
required: true
type: string
- in: formData
name: seconds
description: seconds for which the token will be valid
required: true
type: integer
responses:
default:
description: Status of request
/user/create:
post:
tags:
- user
summary: >-
Create new user inside the scope of an application (identified by App
ID)
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: name
description: Username
required: true
type: string
- in: formData
name: pass
description: User's password
required: true
type: string
- in: formData
name: appId
description: Application ID
required: true
type: string
responses:
default:
description: 'Status of request, includes User ID if successful in `payload` field'
/user/delete:
delete:
tags:
- user
summary: Delete user associated with application (identified by App ID)
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: uid
description: User ID
required: true
type: string
- in: formData
name: appId
description: Application ID
required: true
type: string
responses:
default:
description: Status of request
/token/checkValid:
get:
tags:
- token
summary: Check if token is valid
description: ''
produces:
- application/json
parameters:
- in: query
name: appId
description: Application ID
required: true
type: string
- in: query
name: token
description: Token whose validity is to be checked
required: true
type: string
responses:
default:
description: >-
Status of request, includes `Valid` or `Invalid` message in
`payload` field
/token/generate:
post:
tags:
- token
summary: Generate token
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: uid
description: User IS
required: true
type: string
- in: formData
name: pass
description: User Password
required: true
type: string
- in: formData
name: appId
description: Application ID
required: true
type: string
responses:
default:
description: 'Status of request, includes token string in `payload` field'
/token/delete:
post:
tags:
- token
summary: Remove/Invalidate token
description: ''
consumes:
- application/x-www-form-urlencoded
produces:
- application/json
parameters:
- in: formData
name: appId
description: Application ID
required: true
type: string
- in: formData
name: token
description: Token to be removed/invalidated
required: true
type: string
responses:
default:
description: Status of request