@strapi/plugin-users-permissions 4.3.0-beta.1 → 4.3.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,813 @@
1
+ tags:
2
+ - name: 'Users-Permissions - Auth'
3
+ description: 'Authentication endpoints'
4
+ externalDocs:
5
+ description: 'Find out more'
6
+ url: 'https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html'
7
+
8
+ - name: 'Users-Permissions - Users & Roles'
9
+ description: 'Users, roles, and permissions endpoints'
10
+ externalDocs:
11
+ description: 'Find out more'
12
+ url: 'https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html'
13
+
14
+ paths:
15
+ '/connect/(.*)':
16
+ get:
17
+ tags:
18
+ - Users-Permissions - Auth
19
+ summary: Login with a provider
20
+ description: Redirects to provider login before being redirect to /auth/{provider}/callback
21
+ responses:
22
+ 301:
23
+ description: Redirect response
24
+ default:
25
+ description: Error
26
+ content:
27
+ application/json:
28
+ schema:
29
+ $ref: '#/components/schemas/Error'
30
+ /auth/local:
31
+ post:
32
+ tags:
33
+ - Users-Permissions - Auth
34
+ summary: Local login
35
+ description: Returns a jwt token and user info
36
+ requestBody:
37
+ content:
38
+ application/json:
39
+ schema:
40
+ type: object
41
+ properties:
42
+ identifier:
43
+ type: string
44
+ password:
45
+ type: string
46
+ example:
47
+ identier: foobar
48
+ password: Test1234
49
+ required: true
50
+ responses:
51
+ 200:
52
+ description: Connection
53
+ content:
54
+ application/json:
55
+ schema:
56
+ $ref: '#/components/schemas/Users-Permissions-UserRegistration'
57
+ default:
58
+ description: Error
59
+ content:
60
+ application/json:
61
+ schema:
62
+ $ref: '#/components/schemas/Error'
63
+ /auth/local/register:
64
+ post:
65
+ tags:
66
+ - Users-Permissions - Auth
67
+ summary: Register a user
68
+ description: Returns a jwt token and user info
69
+ requestBody:
70
+ content:
71
+ application/json:
72
+ schema:
73
+ type: object
74
+ properties:
75
+ username:
76
+ type: string
77
+ email:
78
+ type: string
79
+ password:
80
+ type: string
81
+ example:
82
+ username: foobar
83
+ email: foo.bar@strapi.io
84
+ password: Test1234
85
+ required: true
86
+ responses:
87
+ 200:
88
+ description: Successfull registration
89
+ content:
90
+ application/json:
91
+ schema:
92
+ $ref: '#/components/schemas/Users-Permissions-UserRegistration'
93
+ default:
94
+ description: Error
95
+ content:
96
+ application/json:
97
+ schema:
98
+ $ref: '#/components/schemas/Error'
99
+
100
+ /auth/{provider}/callback:
101
+ get:
102
+ tags:
103
+ - Users-Permissions - Auth
104
+ summary: Default Callback from provider auth
105
+ responses:
106
+ 200:
107
+ description: Returns a jwt token and user info
108
+ content:
109
+ application/json:
110
+ schema:
111
+ $ref: '#/components/schemas/Users-Permissions-UserRegistration'
112
+ default:
113
+ description: Error
114
+ content:
115
+ application/json:
116
+ schema:
117
+ $ref: '#/components/schemas/Error'
118
+
119
+ /auth/forgot-password:
120
+ post:
121
+ tags:
122
+ - Users-Permissions - Auth
123
+ summary: Send rest password email
124
+ requestBody:
125
+ required: true
126
+ content:
127
+ application/json:
128
+ schema:
129
+ type: object
130
+ properties:
131
+ email:
132
+ type: string
133
+ example:
134
+ email: foo.bar@strapi.io
135
+ responses:
136
+ 200:
137
+ description: Returns ok
138
+ content:
139
+ application/json:
140
+ schema:
141
+ type: object
142
+ properties:
143
+ ok:
144
+ type: enum
145
+ enum: [true]
146
+ default:
147
+ description: Error
148
+ content:
149
+ application/json:
150
+ schema:
151
+ $ref: '#/components/schemas/Error'
152
+ /auth/reset-password:
153
+ post:
154
+ tags:
155
+ - Users-Permissions - Auth
156
+ summary: Rest user password
157
+ requestBody:
158
+ required: true
159
+ content:
160
+ application/json:
161
+ schema:
162
+ type: object
163
+ properties:
164
+ password:
165
+ type: string
166
+ passwordConfirmation:
167
+ type: string
168
+ code:
169
+ type: string
170
+ example:
171
+ password: Test1234
172
+ passwordConfirmation: Test1234
173
+ code: zertyoaizndoianzodianzdonaizdoinaozdnia
174
+ responses:
175
+ 200:
176
+ description: Returns a jwt token and user info
177
+ content:
178
+ application/json:
179
+ schema:
180
+ $ref: '#/components/schemas/Users-Permissions-UserRegistration'
181
+ default:
182
+ description: Error
183
+ content:
184
+ application/json:
185
+ schema:
186
+ $ref: '#/components/schemas/Error'
187
+
188
+ /auth/email-confirmation:
189
+ get:
190
+ tags:
191
+ - Users-Permissions - Auth
192
+ summary: Confirm user email
193
+ parameters:
194
+ - in: query
195
+ name: confirmation
196
+ type: string
197
+ description: confirmation token received by email
198
+ responses:
199
+ 301:
200
+ description: Redirects to the configure email confirmation redirect url
201
+ default:
202
+ description: Error
203
+ content:
204
+ application/json:
205
+ schema:
206
+ $ref: '#/components/schemas/Error'
207
+
208
+ /auth/send-email-confirmation:
209
+ post:
210
+ tags:
211
+ - Users-Permissions - Auth
212
+ summary: Send confirmation email
213
+ requestBody:
214
+ required: true
215
+ content:
216
+ application/json:
217
+ schema:
218
+ type: object
219
+ properties:
220
+ email:
221
+ type: string
222
+ responses:
223
+ 200:
224
+ description: Returns email and boolean to confirm email was sent
225
+ content:
226
+ application/json:
227
+ schema:
228
+ type: object
229
+ properties:
230
+ email:
231
+ type: string
232
+ sent:
233
+ type: enum
234
+ enum: [true]
235
+ default:
236
+ description: Error
237
+ content:
238
+ application/json:
239
+ schema:
240
+ $ref: '#/components/schemas/Error'
241
+
242
+ /users-permissions/permissions:
243
+ get:
244
+ tags:
245
+ - Users-Permissions - Users & Roles
246
+ summary: Get default generated permissions
247
+ responses:
248
+ 200:
249
+ description: Returns the permissions tree
250
+ content:
251
+ application/json:
252
+ schema:
253
+ type: object
254
+ properties:
255
+ permissions:
256
+ $ref: '#/components/schemas/Users-Permissions-PermissionsTree'
257
+ example:
258
+ permissions:
259
+ api::content-type.content-type:
260
+ controllers:
261
+ controllerA:
262
+ find:
263
+ enabled: false
264
+ policy: ''
265
+ findOne:
266
+ enabled: false
267
+ policy: ''
268
+ create:
269
+ enabled: false
270
+ policy: ''
271
+ controllerB:
272
+ find:
273
+ enabled: false
274
+ policy: ''
275
+ findOne:
276
+ enabled: false
277
+ policy: ''
278
+ create:
279
+ enabled: false
280
+ policy: ''
281
+ default:
282
+ description: Error
283
+ content:
284
+ application/json:
285
+ schema:
286
+ $ref: '#/components/schemas/Error'
287
+
288
+ /users-permissions/roles:
289
+ get:
290
+ tags:
291
+ - Users-Permissions - Users & Roles
292
+ summary: List roles
293
+ responses:
294
+ 200:
295
+ description: Returns list of roles
296
+ content:
297
+ application/json:
298
+ schema:
299
+ type: object
300
+ properties:
301
+ roles:
302
+ type: array
303
+ items:
304
+ allOf:
305
+ - $ref: '#/components/schemas/Users-Permissions-Role'
306
+ - type: object
307
+ properties:
308
+ nb_users:
309
+ type: number
310
+ example:
311
+ roles:
312
+ - id: 1
313
+ name: Public
314
+ description: Default role given to unauthenticated user.
315
+ type: public
316
+ createdAt: 2022-05-19T17:35:35.097Z
317
+ updatedAt: 2022-05-31T16:05:36.603Z
318
+ nb_users: 0
319
+
320
+ default:
321
+ description: Error
322
+ content:
323
+ application/json:
324
+ schema:
325
+ $ref: '#/components/schemas/Error'
326
+
327
+ post:
328
+ tags:
329
+ - Users-Permissions - Users & Roles
330
+ summary: Create a role
331
+ requestBody:
332
+ $ref: '#/components/schemas/Users-Permissions-RoleRequest'
333
+ responses:
334
+ 200:
335
+ description: Returns ok if the role was create
336
+ content:
337
+ application/json:
338
+ schema:
339
+ type: object
340
+ properties:
341
+ ok:
342
+ type: enum
343
+ enum: [true]
344
+ default:
345
+ description: Error
346
+ content:
347
+ application/json:
348
+ schema:
349
+ $ref: '#/components/schemas/Error'
350
+
351
+ /users-permissions/roles/{id}:
352
+ get:
353
+ tags:
354
+ - Users-Permissions - Users & Roles
355
+ summary: Get a role
356
+ parameters:
357
+ - in: path
358
+ name: id
359
+ type: string
360
+ description: role Id
361
+ responses:
362
+ 200:
363
+ content:
364
+ application/json:
365
+ schema:
366
+ type: object
367
+ properties:
368
+ role:
369
+ $ref: '#/components/schemas/Users-Permissions-Role'
370
+ example:
371
+ role:
372
+ id: 1
373
+ name: Public
374
+ description: Default role given to unauthenticated user.
375
+ type: public
376
+ createdAt: 2022-05-19T17:35:35.097Z
377
+ updatedAt: 2022-05-31T16:05:36.603Z
378
+ permissions:
379
+ api::content-type.content-type:
380
+ controllers:
381
+ controllerA:
382
+ find:
383
+ enabled: true
384
+ default:
385
+ description: Error
386
+ content:
387
+ application/json:
388
+ schema:
389
+ $ref: '#/components/schemas/Error'
390
+
391
+ /users-permissions/roles/{role}:
392
+ put:
393
+ tags:
394
+ - Users-Permissions - Users & Roles
395
+ summary: Update a role
396
+ parameters:
397
+ - in: path
398
+ name: role
399
+ type: string
400
+ description: role Id
401
+ requestBody:
402
+ $ref: '#/components/schemas/Users-Permissions-RoleRequest'
403
+ responses:
404
+ 200:
405
+ description: Returns ok if the role was udpated
406
+ content:
407
+ application/json:
408
+ schema:
409
+ type: object
410
+ properties:
411
+ ok:
412
+ type: enum
413
+ enum: [true]
414
+ default:
415
+ description: Error
416
+ content:
417
+ application/json:
418
+ schema:
419
+ $ref: '#/components/schemas/Error'
420
+
421
+ delete:
422
+ tags:
423
+ - Users-Permissions - Users & Roles
424
+ summary: Delete a role
425
+ parameters:
426
+ - in: path
427
+ name: role
428
+ type: string
429
+ description: role Id
430
+ responses:
431
+ 200:
432
+ description: Returns ok if the role was delete
433
+ content:
434
+ application/json:
435
+ schema:
436
+ type: object
437
+ properties:
438
+ ok:
439
+ type: enum
440
+ enum: [true]
441
+ default:
442
+ description: Error
443
+ content:
444
+ application/json:
445
+ schema:
446
+ $ref: '#/components/schemas/Error'
447
+
448
+ /users:
449
+ get:
450
+ tags:
451
+ - Users-Permissions - Users & Roles
452
+ summary: Get list of users
453
+ responses:
454
+ 200:
455
+ summary: Returns an array of users
456
+ content:
457
+ application/json:
458
+ schema:
459
+ type: array
460
+ items:
461
+ $ref: '#/components/schemas/Users-Permissions-User'
462
+ example:
463
+ - id: 9
464
+ username: foao@strapi.io
465
+ email: foao@strapi.io
466
+ provider: local
467
+ confirmed: false
468
+ blocked: false
469
+ createdAt: 2022-06-01T18:32:35.211Z
470
+ updatedAt: 2022-06-01T18:32:35.217Z
471
+ default:
472
+ description: Error
473
+ content:
474
+ application/json:
475
+ schema:
476
+ $ref: '#/components/schemas/Error'
477
+
478
+ post:
479
+ tags:
480
+ - Users-Permissions - Users & Roles
481
+ summary: Create a user
482
+ requestBody:
483
+ required: true
484
+ content:
485
+ application/json:
486
+ schema:
487
+ type: object
488
+ properties:
489
+ email:
490
+ type: string
491
+ required: true
492
+ username:
493
+ type: string
494
+ required: true
495
+ password:
496
+ type: string
497
+ required: true
498
+
499
+ example:
500
+ username: foo
501
+ email: foo@strapi.io
502
+ password: foo-password
503
+ responses:
504
+ 201:
505
+ description: Returns created user info
506
+ content:
507
+ application/json:
508
+ schema:
509
+ allOf:
510
+ - $ref: '#/components/schemas/Users-Permissions-User'
511
+ - type: object
512
+ properties:
513
+ role:
514
+ $ref: '#/components/schemas/Users-Permissions-Role'
515
+ example:
516
+ id: 1
517
+ username: foo
518
+ email: foo@strapi.io
519
+ provider: local
520
+ confirmed: false
521
+ blocked: false
522
+ createdAt: 2022-05-19T17:35:35.096Z
523
+ updatedAt: 2022-05-19T17:35:35.096Z
524
+ role:
525
+ id: 1
526
+ name: X
527
+ description: Default role given to authenticated user.
528
+ type: authenticated
529
+ createdAt: 2022-05-19T17:35:35.096Z
530
+ updatedAt: 2022-06-04T07:11:59.551Z
531
+ default:
532
+ description: Error
533
+ content:
534
+ application/json:
535
+ schema:
536
+ $ref: '#/components/schemas/Error'
537
+
538
+ /users/{id}:
539
+ get:
540
+ tags:
541
+ - Users-Permissions - Users & Roles
542
+ summary: Get a user
543
+ parameters:
544
+ - in: path
545
+ name: id
546
+ type: string
547
+ description: user Id
548
+ responses:
549
+ 200:
550
+ content:
551
+ application/json:
552
+ schema:
553
+ $ref: '#/components/schemas/Users-Permissions-User'
554
+ example:
555
+ id: 1
556
+ username: foo
557
+ email: foo@strapi.io
558
+ provider: local
559
+ confirmed: false
560
+ blocked: false
561
+ createdAt: 2022-05-19T17:35:35.096Z
562
+ updatedAt: 2022-05-19T17:35:35.096Z
563
+ default:
564
+ description: Error
565
+ content:
566
+ application/json:
567
+ schema:
568
+ $ref: '#/components/schemas/Error'
569
+
570
+ put:
571
+ tags:
572
+ - Users-Permissions - Users & Roles
573
+ summary: Update a user
574
+ parameters:
575
+ - in: path
576
+ name: id
577
+ type: string
578
+ description: user Id
579
+ requestBody:
580
+ required: true
581
+ content:
582
+ application/json:
583
+ schema:
584
+ type: object
585
+ properties:
586
+ email:
587
+ type: string
588
+ required: true
589
+ username:
590
+ type: string
591
+ required: true
592
+ password:
593
+ type: string
594
+ required: true
595
+
596
+ example:
597
+ username: foo
598
+ email: foo@strapi.io
599
+ password: foo-password
600
+ responses:
601
+ 200:
602
+ description: Returns updated user info
603
+ content:
604
+ application/json:
605
+ schema:
606
+ allOf:
607
+ - $ref: '#/components/schemas/Users-Permissions-User'
608
+ - type: object
609
+ properties:
610
+ role:
611
+ $ref: '#/components/schemas/Users-Permissions-Role'
612
+ example:
613
+ id: 1
614
+ username: foo
615
+ email: foo@strapi.io
616
+ provider: local
617
+ confirmed: false
618
+ blocked: false
619
+ createdAt: 2022-05-19T17:35:35.096Z
620
+ updatedAt: 2022-05-19T17:35:35.096Z
621
+ role:
622
+ id: 1
623
+ name: X
624
+ description: Default role given to authenticated user.
625
+ type: authenticated
626
+ createdAt: 2022-05-19T17:35:35.096Z
627
+ updatedAt: 2022-06-04T07:11:59.551Z
628
+ default:
629
+ description: Error
630
+ content:
631
+ application/json:
632
+ schema:
633
+ $ref: '#/components/schemas/Error'
634
+
635
+ delete:
636
+ tags:
637
+ - Users-Permissions - Users & Roles
638
+ summary: Delete a user
639
+ responses:
640
+ 200:
641
+ description: Returns deleted user info
642
+ content:
643
+ application/json:
644
+ schema:
645
+ allOf:
646
+ - $ref: '#/components/schemas/Users-Permissions-User'
647
+ example:
648
+ id: 1
649
+ username: foo
650
+ email: foo@strapi.io
651
+ provider: local
652
+ confirmed: false
653
+ blocked: false
654
+ createdAt: 2022-05-19T17:35:35.096Z
655
+ updatedAt: 2022-05-19T17:35:35.096Z
656
+ default:
657
+ description: Error
658
+ content:
659
+ application/json:
660
+ schema:
661
+ $ref: '#/components/schemas/Error'
662
+ /users/me:
663
+ get:
664
+ tags:
665
+ - Users-Permissions - Users & Roles
666
+ summary: Get authenticated user info
667
+ responses:
668
+ 200:
669
+ description: Returns user info
670
+ content:
671
+ application/json:
672
+ schema:
673
+ $ref: '#/components/schemas/Users-Permissions-User'
674
+ example:
675
+ id: 1
676
+ username: foo
677
+ email: foo@strapi.io
678
+ provider: local
679
+ confirmed: false
680
+ blocked: false
681
+ createdAt: 2022-05-19T17:35:35.096Z
682
+ updatedAt: 2022-05-19T17:35:35.096Z
683
+ default:
684
+ description: Error
685
+ content:
686
+ application/json:
687
+ schema:
688
+ $ref: '#/components/schemas/Error'
689
+
690
+ /users/count:
691
+ get:
692
+ tags:
693
+ - Users-Permissions - Users & Roles
694
+ summary: Get user count
695
+ responses:
696
+ 200:
697
+ description: Returns a number
698
+ content:
699
+ application/json:
700
+ schema:
701
+ type: number
702
+ example: 1
703
+ default:
704
+ description: Error
705
+ content:
706
+ application/json:
707
+ schema:
708
+ $ref: '#/components/schemas/Error'
709
+
710
+ components:
711
+ schemas:
712
+ Users-Permissions-Role:
713
+ type: object
714
+ properties:
715
+ id:
716
+ type: number
717
+ name:
718
+ type: string
719
+ description:
720
+ type: string
721
+ type:
722
+ type: string
723
+ createdAt:
724
+ type: datetime
725
+ updatedAt:
726
+ type: datetime
727
+
728
+ Users-Permissions-User:
729
+ type: object
730
+ properties:
731
+ id:
732
+ type: number
733
+ example: 1
734
+ username:
735
+ type: string
736
+ example: 'foo.bar'
737
+ email:
738
+ type: string
739
+ example: 'foo.bar@strapi.io'
740
+ provider:
741
+ type: string
742
+ example: 'local'
743
+ confirmed:
744
+ type: boolean
745
+ example: true
746
+ blocked:
747
+ type: boolean
748
+ example: false
749
+ createdAt:
750
+ type: datetime
751
+ example: '2022-06-02T08:32:06.258Z'
752
+ updatedAt:
753
+ type: datetime
754
+ example: '2022-06-02T08:32:06.267Z'
755
+
756
+ Users-Permissions-UserRegistration:
757
+ type: object
758
+ properties:
759
+ jwt:
760
+ type: string
761
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
762
+ user:
763
+ $ref: '#/components/schemas/Users-Permissions-User'
764
+
765
+ Users-Permissions-PermissionsTree:
766
+ type: object
767
+ additionalProperties:
768
+ type: object
769
+ description: every api
770
+ properties:
771
+ controllers:
772
+ description: every controller of the api
773
+ type: object
774
+ additionalProperties:
775
+ type: object
776
+ additionalProperties:
777
+ description: every action of every controller
778
+ type: object
779
+ properties:
780
+ enabled:
781
+ type: boolean
782
+ policy:
783
+ type: string
784
+
785
+ Users-Permissions-RoleRequest:
786
+ required: true
787
+ content:
788
+ application/json:
789
+ schema:
790
+ type: object
791
+ properties:
792
+ name:
793
+ type: string
794
+ description:
795
+ type: string
796
+ type:
797
+ type: string
798
+ permissions:
799
+ $ref: '#/components/schemas/Users-Permissions-PermissionsTree'
800
+ example:
801
+ name: foo
802
+ description: role foo
803
+ permissions:
804
+ api::content-type.content-type:
805
+ controllers:
806
+ controllerA:
807
+ find:
808
+ enabled: true
809
+
810
+ parameters:
811
+ responses:
812
+ examples:
813
+ requestBodies: