-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yml
756 lines (752 loc) · 22.2 KB
/
openapi.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
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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
openapi: 3.0.0
servers:
- description: Production
url: 'https://identity.eurofurence.org/api/v1'
- description: Local
url: 'https://identity.eurofurence.localhost/api/v1'
info:
version: 1.0.0
title: Eurofurence Identity
contact:
email: [email protected]
name: Thiritin
license:
name: Licensed under MIT
url: 'https://github.com/Thiritin/identity/blob/main/LICENSE'
termsOfService: 'https://help.eurofurence.org/legal/terms'
description: |-
This is the official API Documentation for the Eurofurence Identity service. This can be used to query or automated different things within the Identity service.
To request a new oauth2 client contact [Thiritin](https://t.me/thiritin) via telegram.
x-logo:
url: 'https://raw.githubusercontent.com/Thiritin/identity/main/resources/assets/ef.svg'
backgroundColor: '#004e4c'
altText: Eurofurence e.V. Logo
tags:
- name: Open ID Connect
description: Endpoints related to OpenID Connect
- name: Groups
description: Endpoints related the Group resource
- name: Group Memberships
security:
- OpenID:
- openid
- offline
- offline_access
- profile
- email
- groups
- groups.read
- groups.write
- groups.delete
- AccessToken:
- read
- write
- groups.read
- groups.write
- groups.delete
paths:
/userinfo:
get:
summary: Get userinfo of the user
security:
- OpenID:
- openid
- profile
- email
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Userinfo'
description: OK
tags:
- Open ID Connect
operationId: getUserinfo
/introspect:
post:
summary: Introspect Token
description: >-
The introspection endpoint allows to check if a token (both refresh and
access) is active or not. An active token is neither expired nor revoked.
If a token is active, additional information on the token will be included.
Please note that this endpoint does require authorization by a client_id and client_secret combination.
The client_secret must be submitted as a Bearer token.
security:
- ClientSecret: [ ]
requestBody:
description: "Introspect a token"
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/TokenIntrospection'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/TokenIntrospection'
description: OK
tags:
- Open ID Connect
operationId: introspectToken
/groups:
get:
summary: Get all groups
security:
- OpenID:
- groups.read
- AccessToken:
- groups.read
description: This call returns a paginated result of all groups.
parameters:
- in: query
name: page
schema:
type: integer
description: Used for pagination.
example: 1
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
oneOf:
- $ref: '#/components/schemas/Group'
links:
type: object
properties:
first:
type: string
example: 'https://identity.eurofurence.org/api/v1/groups?page=1'
last:
type: string
nullable: true
example: 'https://identity.eurofurence.org/api/v1/groups?page=5'
prev:
type: string
nullable: true
example: null
next:
type: string
nullable: true
example: 'https://identity.eurofurence.org/api/v1/groups?page=2'
meta:
type: object
properties:
current_page:
type: integer
example: 1
from:
type: integer
example: 1
path:
type: integer
example: 5
to:
type: integer
example: 25
description: OK
tags:
- Groups
operationId: getGroups
post:
operationId: createGroup
summary: Create a new group
security:
- OpenID:
- groups.create
- AccessToken:
- groups.create
description: This call returns a paginated result of all groups.
requestBody:
description: Create a new group
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Group'
responses:
'201':
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Group'
description: OK
tags:
- Groups
'/groups/{group}':
get:
summary: Get single group
security:
- OpenID:
- groups.read
- AccessToken:
- groups.read
description: This call returns a paginated result of all groups.
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
example: 8513K1FW0H4W2SJG
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Group'
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Groups
operationId: getGroup
put:
summary: Update single group
security:
- OpenID:
- groups.update
- AccessToken:
- groups.update
description: This call updates a single group.
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
example: 8513K1FW0H4W2SJG
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Group'
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Groups
operationId: putGroup
patch:
summary: Update single group
security:
- OpenID:
- groups.update
- AccessToken:
- groups.update
description: This call updates a single group.
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Group'
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Groups
operationId: patchGroup
delete:
summary: Deletes a group
description: Delete a group with the given identifier
security:
- OpenID:
- groups.delete
- AccessToken:
- groups.delete
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
example: 8513K1FW0H4W2SJG
responses:
'204':
description: No Content
content:
text/html:
example: ''
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Groups
operationId: deleteGroup
'/groups/{group}/users':
get:
summary: List members
description: Show members of the groups.
security:
- OpenID:
- groups.update
- AccessToken:
- groups.update
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
example: 8513K1FW0H4W2SJG
- in: query
name: 'filter[level]'
schema:
type: string
examples:
member:
value: member
description: Shows any member that has the member level.
moderator:
value: moderator
description: Shows any member that has the moderator level.
admin:
value: admin
description: Shows any member that has the admin level.
owner:
value: owner
description: Shows any member that has the owner level.
description: Filter results by user level (By default, all members are shown)
required: true
responses:
'200':
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
oneOf:
- $ref: '#/components/schemas/GroupUser'
links:
type: object
properties:
first:
type: string
example: 'https://identity.eurofurence.org/api/v1/groups/Y6K08PEKXG9Q7ZWJ/users?page=1'
last:
type: string
nullable: true
example: 'https://identity.eurofurence.org/api/v1/groups/Y6K08PEKXG9Q7ZWJ/users?page=10'
prev:
type: string
nullable: true
example: null
next:
type: string
nullable: true
example: 'https://identity.eurofurence.org/api/v1/groups/Y6K08PEKXG9Q7ZWJ/users?page=2'
meta:
type: object
properties:
current_page:
type: integer
example: 1
from:
type: integer
example: 1
path:
type: integer
example: 5
to:
type: integer
example: 100
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Group Memberships
operationId: getGroupUsers
post:
summary: Add member
description: Add a new user to the group.
security:
- OpenID:
- groups.update
- AccessToken:
- groups.update
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
example: 8513K1FW0H4W2SJG
requestBody:
description: Add a user to a group
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GroupUserForm'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/GroupUserForm'
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/GroupUser'
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
message: Not Found!
description: Not Found
tags:
- Group Memberships
operationId: createGroupUser
'/groups/{group}/users/{user}':
delete:
summary: Remove member
description: Remove a user account from the group
security:
- OpenID:
- groups.delete
- AccessToken:
- groups.delete
parameters:
- in: path
name: group
schema:
type: string
description: Group Identifier
required: true
- in: path
name: user
schema:
type: string
description: User's UUID
required: true
example: 1VJEQAYWW54TZ5VD
responses:
'204':
description: No Content
content:
text/html:
example: ''
tags:
- Group Memberships
operationId: deleteGroupUser
components:
schemas:
Userinfo:
type: object
properties:
sub:
readOnly: true
type: string
description: Uuid of the user
name:
readOnly: true
type: string
description: Choosen username by the user
email:
readOnly: true
type: string
description: Primary email of the user
email_verified:
readOnly: true
type: boolean
description: 'Boolean value, true if email is verified. false if email is not verified.'
avatar:
readOnly: true
type: string
description: Returns full url of users avatar.
groups:
type: array
uniqueItems: true
readOnly: true
items:
type: string
TokenIntrospection:
type: object
properties:
token:
required: true
writeOnly: true
type: string
description: The string value of the token. For access tokens, this is the "access_token" value returned from the token endpoint defined in OAuth 2.0. For refresh tokens, this is the "refresh_token" value returned.
active:
description: |-
Active is a boolean indicator of whether or not the presented token
is currently active. The specifics of a token's "active" state
will vary depending on the implementation of the authorization
server and the information it keeps about its tokens, but a "true"
value return for the "active" property will generally indicate
that a given token has been issued by this authorization server,
has not been revoked by the resource owner, and is within its
given time window of validity (e.g., after its issuance time and
before its expiration time).
type: boolean
readOnly: true
aud:
description: Audience contains a list of the token's intended audiences.
type: array
readOnly: true
items:
type: string
client_id:
required: true
description: |-
ID is a client identifier for an OAuth 2.0 client.
type: string
exp:
description: |-
Expires at is an integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token will expire.
readOnly: true
type: integer
format: int64
ext:
description: Extra is arbitrary data set by the session.
readOnly: true
type: object
additionalProperties: { }
iat:
description: |-
Issued at is an integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token was
originally issued.
readOnly: true
type: integer
format: int64
iss:
description: IssuerURL is a string representing the issuer of this token
readOnly: true
type: string
nbf:
description: |-
NotBefore is an integer timestamp, measured in the number of seconds
since January 1 1970 UTC, indicating when this token is not to be
used before.
readOnly: true
type: integer
format: int64
obfuscated_subject:
description: >-
ObfuscatedSubject is set when the subject identifier algorithm was set
to "pairwise" during authorization.
It is the `sub` value of the ID Token that was issued.
readOnly: true
type: string
scope:
description: |-
Scope is a JSON string containing a space-separated list of
scopes associated with this token.
type: string
sub:
description: |-
Subject of the token, as defined in JWT [RFC7519].
Usually a machine-readable identifier of the resource owner who
authorized this token.
readOnly: true
type: string
token_type:
description: TokenType is the introspected token's type, typically `Bearer`.
readOnly: true
type: string
token_use:
description: >-
TokenUse is the introspected token's use, for example `access_token`
or `refresh_token`.
readOnly: true
type: string
username:
description: |-
Username is a human-readable identifier for the resource owner who
authorized this token.
readOnly: true
type: string
GroupUser:
type: object
properties:
group_id:
readOnly: true
type: string
description: The group id
user_id:
type: string
description: The user id
level:
type: string
enum:
- member
- moderator
- admin
- owner
GroupUserForm:
type: object
properties:
level:
type: string
enum:
- member
- moderator
- admin
- owner
default: member
required:
- level
oneOf:
- properties:
id:
type: string
description: The user id, cannot be used with email when adding a user
example: 1VJEQAYWW54TZ5VD
required:
- id
- properties:
email:
type: string
description: The email of the user, cannot be used with id when adding a user
example: [email protected]
required:
- email
Group:
type: object
properties:
id:
readOnly: true
type: string
description: The groups uuid
example: Y6K08PEKXG9Q7ZWJ
type:
default: none
enum:
- none
- department
name:
type: string
example: Attendees 2021
description:
type: string
example: <b>Thanks for Attending Eurofurence 2021</b>
logo:
type: string
description: URL to the groups logo
example: 'http://identity.eurofurence.org/storage/avatars/mqKYRqC8aEXifh1muaTJgzIysGRykr-metaMTIucG5n-.png'
slug:
type: string
readOnly: true
description: 'Unique identifier for the group, but not immuteable.'
example: attendees-2021
translations:
type: object
readOnly: true
properties:
name:
type: object
nullable: true
properties:
en:
type: string
example: Attendees 2021
de:
type: string
example: Teilnehmer 2021
description:
type: object
nullable: true
properties:
en:
type: string
example: <b>Thanks for Attending Eurofurence 2021</b>
de:
type: string
example: <b>Vielen Dank für die teilnahme Eurofurence 2021</b>
created_at:
type: string
example: '2022-12-10T20:41:34.000000Z'
updated_at:
type: string
example: '2022-12-10T20:41:34.000000Z'
Error:
type: object
properties:
message:
type: string
securitySchemes:
OpenID:
type: openIdConnect
openIdConnectUrl: 'https://identity.eurofurence.org/.well-known/openid-configuration'
description: OpenID Connect
AccessToken:
type: http
scheme: bearer
ClientSecret:
type: http
scheme: bearer