aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/api/openapi.yaml
diff options
context:
space:
mode:
authorWicklow <123956049+wickloww@users.noreply.github.com>2023-06-29 07:48:55 +0000
committerGitHub <noreply@github.com>2023-06-29 09:48:55 +0200
commit40346ead2b0b7afa475aef057d3673b6c7574b7a (patch)
tree24ffdc23c3a9d987334842e0d400b5bd44500cf7 /support/doc/api/openapi.yaml
parentae22c59f14d0d553f60b281948b6c232c2aca178 (diff)
downloadPeerTube-40346ead2b0b7afa475aef057d3673b6c7574b7a.tar.gz
PeerTube-40346ead2b0b7afa475aef057d3673b6c7574b7a.tar.zst
PeerTube-40346ead2b0b7afa475aef057d3673b6c7574b7a.zip
Feature/password protected videos (#5836)
* Add server endpoints * Refactoring test suites * Update server and add openapi documentation * fix compliation and tests * upload/import password protected video on client * add server error code * Add video password to update resolver * add custom message when sharing pw protected video * improve confirm component * Add new alert in component * Add ability to watch protected video on client * Cannot have password protected replay privacy * Add migration * Add tests * update after review * Update check params tests * Add live videos test * Add more filter test * Update static file privacy test * Update object storage tests * Add test on feeds * Add missing word * Fix tests * Fix tests on live videos * add embed support on password protected videos * fix style * Correcting data leaks * Unable to add password protected privacy on replay * Updated code based on review comments * fix validator and command * Updated code based on review comments
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r--support/doc/api/openapi.yaml120
1 files changed, 119 insertions, 1 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml
index cd50e86a6..ff94f802b 100644
--- a/support/doc/api/openapi.yaml
+++ b/support/doc/api/openapi.yaml
@@ -300,6 +300,8 @@ tags:
300 - name: Runner Registration Token 300 - name: Runner Registration Token
301 description: | 301 description: |
302 Manage runner registration token 302 Manage runner registration token
303 - name: Video Passwords
304 description: Operation on video passwords
303 305
304x-tagGroups: 306x-tagGroups:
305 - name: Static endpoints 307 - name: Static endpoints
@@ -337,6 +339,7 @@ x-tagGroups:
337 - Video Transcoding 339 - Video Transcoding
338 - Live Videos 340 - Live Videos
339 - Channels Sync 341 - Channels Sync
342 - Video Passwords
340 - name: Search 343 - name: Search
341 tags: 344 tags:
342 - Search 345 - Search
@@ -2359,6 +2362,7 @@ paths:
2359 - OAuth2: [] 2362 - OAuth2: []
2360 parameters: 2363 parameters:
2361 - $ref: '#/components/parameters/idOrUUID' 2364 - $ref: '#/components/parameters/idOrUUID'
2365 - $ref: '#/components/parameters/videoPasswordHeader'
2362 responses: 2366 responses:
2363 '200': 2367 '200':
2364 description: successful operation 2368 description: successful operation
@@ -2578,6 +2582,8 @@ paths:
2578 format: date-time 2582 format: date-time
2579 scheduleUpdate: 2583 scheduleUpdate:
2580 $ref: '#/components/schemas/VideoScheduledUpdate' 2584 $ref: '#/components/schemas/VideoScheduledUpdate'
2585 videoPasswords:
2586 $ref: '#/components/schemas/AddVideoPasswords'
2581 encoding: 2587 encoding:
2582 thumbnailfile: 2588 thumbnailfile:
2583 contentType: image/jpeg 2589 contentType: image/jpeg
@@ -2590,6 +2596,7 @@ paths:
2590 - Video 2596 - Video
2591 parameters: 2597 parameters:
2592 - $ref: '#/components/parameters/idOrUUID' 2598 - $ref: '#/components/parameters/idOrUUID'
2599 - $ref: '#/components/parameters/videoPasswordHeader'
2593 responses: 2600 responses:
2594 '200': 2601 '200':
2595 description: successful operation 2602 description: successful operation
@@ -2597,6 +2604,8 @@ paths:
2597 application/json: 2604 application/json:
2598 schema: 2605 schema:
2599 $ref: '#/components/schemas/VideoDetails' 2606 $ref: '#/components/schemas/VideoDetails'
2607 '403':
2608 description: provide a correct password to access this password protected video
2600 delete: 2609 delete:
2601 summary: Delete a video 2610 summary: Delete a video
2602 operationId: delVideo 2611 operationId: delVideo
@@ -2618,6 +2627,7 @@ paths:
2618 - Video 2627 - Video
2619 parameters: 2628 parameters:
2620 - $ref: '#/components/parameters/idOrUUID' 2629 - $ref: '#/components/parameters/idOrUUID'
2630 - $ref: '#/components/parameters/videoPasswordHeader'
2621 responses: 2631 responses:
2622 '200': 2632 '200':
2623 description: successful operation 2633 description: successful operation
@@ -3267,6 +3277,7 @@ paths:
3267 - Live Videos 3277 - Live Videos
3268 parameters: 3278 parameters:
3269 - $ref: '#/components/parameters/idOrUUID' 3279 - $ref: '#/components/parameters/idOrUUID'
3280 - $ref: '#/components/parameters/videoPasswordHeader'
3270 responses: 3281 responses:
3271 '200': 3282 '200':
3272 description: successful operation 3283 description: successful operation
@@ -3665,6 +3676,7 @@ paths:
3665 - Video Captions 3676 - Video Captions
3666 parameters: 3677 parameters:
3667 - $ref: '#/components/parameters/idOrUUID' 3678 - $ref: '#/components/parameters/idOrUUID'
3679 - $ref: '#/components/parameters/videoPasswordHeader'
3668 responses: 3680 responses:
3669 '200': 3681 '200':
3670 description: successful operation 3682 description: successful operation
@@ -3728,6 +3740,70 @@ paths:
3728 '404': 3740 '404':
3729 description: video or language or caption for that language not found 3741 description: video or language or caption for that language not found
3730 3742
3743 /api/v1/videos/{id}/passwords:
3744 get:
3745 summary: List video passwords
3746 security:
3747 - OAuth2:
3748 - user
3749 tags:
3750 - Video Passwords
3751 parameters:
3752 - $ref: '#/components/parameters/idOrUUID'
3753 - $ref: '#/components/parameters/start'
3754 - $ref: '#/components/parameters/count'
3755 - $ref: '#/components/parameters/sort'
3756 responses:
3757 '204':
3758 description: successful operation
3759 content:
3760 application/json:
3761 schema:
3762 $ref: '#/components/schemas/VideoPasswordList'
3763 '400':
3764 description: video is not password protected
3765 put:
3766 summary: Update video passwords
3767 security:
3768 - OAuth2:
3769 - user
3770 tags:
3771 - Video Passwords
3772 parameters:
3773 - $ref: '#/components/parameters/idOrUUID'
3774 requestBody:
3775 content:
3776 application/json:
3777 schema:
3778 type: object
3779 properties:
3780 passwords:
3781 $ref: '#/components/schemas/AddVideoPasswords'
3782 responses:
3783 '204':
3784 description: successful operation
3785 '400':
3786 description: video is not password protected
3787
3788 /api/v1/videos/{id}/passwords/{videoPasswordId}:
3789 delete:
3790 summary: Delete a video password
3791 security:
3792 - OAuth2:
3793 - user
3794 tags:
3795 - Video Passwords
3796 parameters:
3797 - $ref: '#/components/parameters/idOrUUID'
3798 - $ref: '#/components/parameters/videoPasswordId'
3799 responses:
3800 '204':
3801 description: successful operation
3802 '403':
3803 description: cannot delete the last password of the protected video
3804 '400':
3805 description: video is not password protected
3806
3731 /api/v1/video-channels: 3807 /api/v1/video-channels:
3732 get: 3808 get:
3733 summary: List video channels 3809 summary: List video channels
@@ -4554,6 +4630,7 @@ paths:
4554 - $ref: '#/components/parameters/start' 4630 - $ref: '#/components/parameters/start'
4555 - $ref: '#/components/parameters/count' 4631 - $ref: '#/components/parameters/count'
4556 - $ref: '#/components/parameters/commentsSort' 4632 - $ref: '#/components/parameters/commentsSort'
4633 - $ref: '#/components/parameters/videoPasswordHeader'
4557 responses: 4634 responses:
4558 '200': 4635 '200':
4559 description: successful operation 4636 description: successful operation
@@ -4600,6 +4677,7 @@ paths:
4600 parameters: 4677 parameters:
4601 - $ref: '#/components/parameters/idOrUUID' 4678 - $ref: '#/components/parameters/idOrUUID'
4602 - $ref: '#/components/parameters/threadId' 4679 - $ref: '#/components/parameters/threadId'
4680 - $ref: '#/components/parameters/videoPasswordHeader'
4603 responses: 4681 responses:
4604 '200': 4682 '200':
4605 description: successful operation 4683 description: successful operation
@@ -4618,6 +4696,7 @@ paths:
4618 parameters: 4696 parameters:
4619 - $ref: '#/components/parameters/idOrUUID' 4697 - $ref: '#/components/parameters/idOrUUID'
4620 - $ref: '#/components/parameters/commentId' 4698 - $ref: '#/components/parameters/commentId'
4699 - $ref: '#/components/parameters/videoPasswordHeader'
4621 responses: 4700 responses:
4622 '200': 4701 '200':
4623 description: successful operation 4702 description: successful operation
@@ -4668,6 +4747,7 @@ paths:
4668 - Video Rates 4747 - Video Rates
4669 parameters: 4748 parameters:
4670 - $ref: '#/components/parameters/idOrUUID' 4749 - $ref: '#/components/parameters/idOrUUID'
4750 - $ref: '#/components/parameters/videoPasswordHeader'
4671 requestBody: 4751 requestBody:
4672 content: 4752 content:
4673 application/json: 4753 application/json:
@@ -6525,7 +6605,20 @@ components:
6525 required: true 6605 required: true
6526 schema: 6606 schema:
6527 $ref: '#/components/schemas/UUIDv4' 6607 $ref: '#/components/schemas/UUIDv4'
6528 6608 videoPasswordId:
6609 name: videoPasswordId
6610 in: path
6611 required: true
6612 description: The video password id
6613 schema:
6614 $ref: '#/components/schemas/id'
6615 videoPasswordHeader:
6616 name: x-peertube-video-password
6617 description: Required on password protected video
6618 in: header
6619 required: false
6620 schema:
6621 type: string
6529 securitySchemes: 6622 securitySchemes:
6530 OAuth2: 6623 OAuth2:
6531 description: | 6624 description: |
@@ -8228,6 +8321,8 @@ components:
8228 description: Video preview file 8321 description: Video preview file
8229 type: string 8322 type: string
8230 format: binary 8323 format: binary
8324 videoPasswords:
8325 $ref: '#/components/schemas/AddVideoPasswords'
8231 required: 8326 required:
8232 - channelId 8327 - channelId
8233 - name 8328 - name
@@ -9616,6 +9711,29 @@ components:
9616 privatePayload: 9711 privatePayload:
9617 type: object 9712 type: object
9618 9713
9714 VideoPassword:
9715 properties:
9716 id:
9717 $ref: '#/components/schemas/id'
9718 password:
9719 type: string
9720 minLength: 2
9721 videoId:
9722 $ref: '#/components/schemas/id'
9723 VideoPasswordList:
9724 properties:
9725 total:
9726 type: integer
9727 example: 1
9728 data:
9729 type: array
9730 items:
9731 $ref: '#/components/schemas/VideoPassword'
9732 AddVideoPasswords:
9733 type: array
9734 items:
9735 $ref: "#/components/schemas/VideoPassword/properties/password"
9736 uniqueItems: true
9619 callbacks: 9737 callbacks:
9620 searchIndex: 9738 searchIndex:
9621 'https://search.example.org/api/v1/search/videos': 9739 'https://search.example.org/api/v1/search/videos':