-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpublicauth_spec.yaml
315 lines (315 loc) · 7.93 KB
/
publicauth_spec.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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
openapi: 3.0.1
info:
description: Publicauth API
title: Publicauth API
version: v1.0.0
paths:
/healthcheck:
get:
operationId: healthCheck
responses:
"200":
content:
application/json:
schema:
type: string
example:
postgres:
healthy: true
message: Healthy
deadlocks:
healthy: true
message: Healthy
description: OK
"503":
description: Service unavailable. If any healthchecks fail
summary: "Healthcheck endpoint for webhooks. Check database, and deadlocks"
tags:
- Other
/v1/api/auth:
get:
operationId: authenticate
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AuthResponse"
description: OK
"401":
description: Unauthorized
security:
- BearerAuth: []
summary: Look up the account ID for a token.
tags:
- Auth
/v1/frontend/auth:
post:
operationId: createTokenForAccount
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateTokenRequest"
required: true
responses:
"200":
content:
application/json:
schema:
type: string
example:
token: api_live_6vra8l8mdtsikncr00etcg4ks3lktu88r8fa7k2re3f211cj8t3m1aeug5
description: OK
"422":
description: Invalid or missing required parameters
summary: Generate and return a new token for the given gateway account ID.
tags:
- Auth
put:
operationId: updateTokenDescription
requestBody:
content:
application/json:
schema:
type: string
example:
token_link: 550e8400-e29b-41d4-a716-446655440000
description: Description of the token
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/TokenResponse"
description: OK
"404":
description: Token not found
"422":
description: Invalid or missing missing parameters
summary: Updates the description of an existing dev token.
tags:
- Auth
/v1/frontend/auth/{accountId}:
delete:
operationId: revokeSingleToken
parameters:
- example: 1
in: path
name: accountId
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
type: string
example:
token_link: 74813ca7-1829-4cad-bc0e-684a0288a308
responses:
"200":
content:
application/json:
schema:
type: string
example:
revoked: 4 Apr 2022
description: OK
"404":
description: Token not found
summary: Revokes the supplied token for this account
tags:
- Auth
get:
operationId: getIssuedTokensForAccount
parameters:
- example: 1
in: path
name: accountId
required: true
schema:
type: string
- example: REVOKED
in: query
name: state
schema:
type: string
enum:
- REVOKED
- ACTIVE
- example: API
in: query
name: type
schema:
type: string
enum:
- API
- PRODUCTS
responses:
"200":
content:
application/json:
schema:
type: object
properties:
tokens:
type: array
items:
$ref: "#/components/schemas/TokenResponse"
description: OK
"422":
description: Invalid or missing required parameters
summary: Retrieves generated tokens for gateway account.
tags:
- Auth
/v1/frontend/auth/{accountId}/revoke-all:
delete:
operationId: revokeTokensForAccount
parameters:
- example: 1
in: path
name: accountId
required: true
schema:
type: string
responses:
default:
content:
'*/*': {}
description: default response
summary: "Revokes all tokens associated with a gateway account. It is not possible\
\ to tell whether the gateway account actually exists (in connector), so this\
\ method currently does not return a 404."
tags:
- Auth
/v1/frontend/auth/{accountId}/{tokenLink}:
get:
operationId: getTokenByTokenLink
parameters:
- example: 1
in: path
name: accountId
required: true
schema:
type: string
- example: a-token-link
in: path
name: tokenLink
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/TokenResponse"
description: OK
"404":
description: Token not found
summary: Get a token by gateway account id and token link.
tags:
- Auth
components:
schemas:
AuthResponse:
type: object
properties:
account_id:
type: string
example: "1234"
token_link:
type: string
example: 550e8400-e29b-41d4-a716-446655440000
token_type:
type: string
enum:
- CARD
- DIRECT_DEBIT
example: CARD
CreateTokenRequest:
type: object
properties:
account_id:
type: string
description: Gateway account to associate the new token to
example: "1"
writeOnly: true
created_by:
type: string
example: test@example.org
writeOnly: true
description:
type: string
description: Description of the new token
example: Token description
token_account_type:
type: string
default: LIVE
enum:
- LIVE
- TEST
example: LIVE
writeOnly: true
token_type:
type: string
default: CARD
enum:
- CARD
- DIRECT_DEBIT
example: CARD
writeOnly: true
type:
type: string
default: API
enum:
- API
- PRODUCTS
example: API
writeOnly: true
required:
- account_id
- created_by
- description
JsonNode:
type: object
TokenResponse:
type: object
properties:
created_by:
type: string
example: test@example.org
description:
type: string
example: Description of the token
issued_date:
type: string
example: 04 Apr 2022 - 19:02
last_used:
type: string
example: 05 Apr 2022 - 19:02
revoked:
type: string
example: 05 Apr 2022 - 20:02
token_link:
type: string
example: 550e8400-e29b-41d4-a716-446655440000
token_type:
type: string
enum:
- CARD
- DIRECT_DEBIT
example: CARD
type:
type: string
enum:
- API
- PRODUCTS
example: API
securitySchemes:
BearerAuth:
description: "The Authorisation token needs to be specified in the 'Authorization'\
\ header as `Authorization: Bearer YOUR_API_KEY_HERE`"
scheme: bearer
type: http