openapi: add x-participant-role header parameter and error response for invalid roles. Update related paths to include role validation.

This commit is contained in:
juancarmore 2025-07-11 01:45:11 +02:00
parent fdd897b86b
commit 82592e1f6c
9 changed files with 45 additions and 6 deletions

View File

@ -0,0 +1,12 @@
name: x-participant-role
in: header
description: |
The role of the participant in the meeting. It can be one of the following values:
- `moderator`: Can manage the room and its participants.
- `publisher`: Can publish media streams to the room.
This is required to distinguish roles when multiple are present in the participant token
required: true
schema:
type: string
enum: ['moderator', 'publisher']

View File

@ -1,9 +1,9 @@
name: x-signature
in: header
description: >
HMAC-SHA256 signature of the request body, created using your webhook secret.
HMAC-SHA256 signature of the request body, created using your webhook secret.
Use this to verify the webhook came from OpenVidu Meet and wasn't tampered with.
Use this to verify the webhook came from OpenVidu Meet and wasn't tampered with.
required: true
schema:
type: string
type: string

View File

@ -1,9 +1,9 @@
name: x-timestamp
in: header
description: >
Unix timestamp (in seconds) when the webhook was sent.
Unix timestamp (in seconds) when the webhook was sent.
Can be used to validate webhook age and prevent replay attacks.
Can be used to validate webhook age and prevent replay attacks.
required: true
schema:
type: string

View File

@ -0,0 +1,8 @@
description: Invalid participant role provided
content:
application/json:
schema:
$ref: '../../schemas/error.yaml'
example:
error: Participant Error
message: 'No valid participant role provided'

View File

@ -3,7 +3,7 @@ properties:
role:
type: string
enum: ['moderator', 'publisher']
description: >
description: |
A role that a participant can have in a room.
The role determines the permissions of the participant in the room.
- `moderator`: Can manage the room and its participants.

View File

@ -12,9 +12,12 @@
- participantTokenCookie: []
parameters:
- $ref: '../../components/parameters/room-id-path.yaml'
- $ref: '../../components/parameters/internal/x-participant-role.yaml'
responses:
'200':
$ref: '../../components/responses/internal/success-end-meeting.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../../components/responses/unauthorized-error.yaml'
'403':
@ -36,9 +39,12 @@
parameters:
- $ref: '../../components/parameters/room-id-path.yaml'
- $ref: '../../components/parameters/internal/participant-name.yaml'
- $ref: '../../components/parameters/internal/x-participant-role.yaml'
responses:
'200':
$ref: '../../components/responses/internal/success-delete-participant.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../../components/responses/unauthorized-error.yaml'
'403':

View File

@ -8,11 +8,15 @@
- Internal API - Recordings
security:
- participantTokenCookie: []
parameters:
- $ref: '../../components/parameters/internal/x-participant-role.yaml'
requestBody:
$ref: '../../components/requestBodies/internal/start-recording-request.yaml'
responses:
'201':
$ref: '../../components/responses/internal/success-start-recording.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../../components/responses/unauthorized-error.yaml'
'403':
@ -40,9 +44,12 @@
- participantTokenCookie: []
parameters:
- $ref: '../../components/parameters/recording-id.yaml'
- $ref: '../../components/parameters/internal/x-participant-role.yaml'
responses:
'202':
$ref: '../../components/responses/internal/success-stop-recording.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../../components/responses/unauthorized-error.yaml'
'403':

View File

@ -37,9 +37,12 @@
- participantTokenCookie: []
parameters:
- $ref: '../../components/parameters/room-id-path.yaml'
- $ref: '../../components/parameters/internal/x-participant-role.yaml'
responses:
'200':
$ref: '../../components/responses/internal/success-get-room-preferences.yaml'
'400':
$ref: '../../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../../components/responses/unauthorized-error.yaml'
'403':

View File

@ -101,9 +101,12 @@
parameters:
- $ref: '../components/parameters/room-id-path.yaml'
- $ref: '../components/parameters/room-fields.yaml'
- $ref: '../components/parameters/internal/x-participant-role.yaml'
responses:
'200':
$ref: '../components/responses/success-get-room.yaml'
'400':
$ref: '../components/responses/internal/error-invalid-participant-role.yaml'
'401':
$ref: '../components/responses/unauthorized-error.yaml'
'403':