diff --git a/backend/openapi/components/requestBodies/internal/update-security-preferences.yaml b/backend/openapi/components/requestBodies/internal/update-security-preferences.yaml new file mode 100644 index 0000000..042c034 --- /dev/null +++ b/backend/openapi/components/requestBodies/internal/update-security-preferences.yaml @@ -0,0 +1,6 @@ +description: Security preferences +required: true +content: + application/json: + schema: + $ref: '../../schemas/internal/security-preferences.yaml' diff --git a/backend/openapi/components/requestBodies/internal/update-webhooks-preferences.yaml b/backend/openapi/components/requestBodies/internal/update-webhooks-preferences.yaml new file mode 100644 index 0000000..365ee53 --- /dev/null +++ b/backend/openapi/components/requestBodies/internal/update-webhooks-preferences.yaml @@ -0,0 +1,6 @@ +description: Webhooks preferences +required: true +content: + application/json: + schema: + $ref: '../../schemas/internal/webhooks-preferences.yaml' diff --git a/backend/openapi/components/responses/internal/success-get-security-preferences.yaml b/backend/openapi/components/responses/internal/success-get-security-preferences.yaml new file mode 100644 index 0000000..6bc017b --- /dev/null +++ b/backend/openapi/components/responses/internal/success-get-security-preferences.yaml @@ -0,0 +1,5 @@ +description: Successfully retrieved security preferences +content: + application/json: + schema: + $ref: '../../schemas/internal/security-preferences.yaml' diff --git a/backend/openapi/components/responses/internal/success-get-webhooks-preferences.yaml b/backend/openapi/components/responses/internal/success-get-webhooks-preferences.yaml new file mode 100644 index 0000000..a1e2f47 --- /dev/null +++ b/backend/openapi/components/responses/internal/success-get-webhooks-preferences.yaml @@ -0,0 +1,5 @@ +description: Successfully retrieved webhooks preferences +content: + application/json: + schema: + $ref: '../../schemas/internal/webhooks-preferences.yaml' diff --git a/backend/openapi/components/responses/internal/success-update-security-preferences.yaml b/backend/openapi/components/responses/internal/success-update-security-preferences.yaml new file mode 100644 index 0000000..da5939a --- /dev/null +++ b/backend/openapi/components/responses/internal/success-update-security-preferences.yaml @@ -0,0 +1,9 @@ +description: Successfully updated security preferences +content: + application/json: + schema: + type: object + properties: + message: + type: string + example: 'Security preferences updated successfully' diff --git a/backend/openapi/components/responses/internal/success-update-webhooks-preferences.yaml b/backend/openapi/components/responses/internal/success-update-webhooks-preferences.yaml new file mode 100644 index 0000000..f6b86dc --- /dev/null +++ b/backend/openapi/components/responses/internal/success-update-webhooks-preferences.yaml @@ -0,0 +1,9 @@ +description: Successfully updated webhooks preferences +content: + application/json: + schema: + type: object + properties: + message: + type: string + example: 'Webhooks preferences updated successfully' diff --git a/backend/openapi/components/responses/pro-feature-error.yaml b/backend/openapi/components/responses/pro-feature-error.yaml new file mode 100644 index 0000000..ad61839 --- /dev/null +++ b/backend/openapi/components/responses/pro-feature-error.yaml @@ -0,0 +1,8 @@ +description: PRO Feature Error +content: + application/json: + schema: + $ref: '../schemas/error.yaml' + example: + error: Pro Feature Error + message: 'This operation is a PRO feature. Please, upgrade to OpenVidu PRO' \ No newline at end of file diff --git a/backend/openapi/components/schemas/internal/security-preferences.yaml b/backend/openapi/components/schemas/internal/security-preferences.yaml new file mode 100644 index 0000000..ade41df --- /dev/null +++ b/backend/openapi/components/schemas/internal/security-preferences.yaml @@ -0,0 +1,45 @@ +type: object +properties: + authentication: + $ref: '#/AuthenticationPreferences' + description: Preferences for authentication. + roomCreationPolicy: + $ref: '#/RoomCreationPolicy' + description: Preferences for room creation policy. + +AuthenticationPreferences: + type: object + properties: + authMode: + type: string + enum: + - none + - moderators_only + - all_users + default: none + example: none + description: The authentication mode to enter a room. + method: + type: object + properties: + type: + type: string + enum: + - single-user + default: single-user + example: single-user + description: The authentication method to use. + +RoomCreationPolicy: + type: object + properties: + allowRoomCreation: + type: boolean + default: true + example: true + description: If true, users will be allowed to create rooms. + requireAuthentication: + type: boolean + default: true + example: true + description: If true, users will be required to authenticate before creating rooms. diff --git a/backend/openapi/components/schemas/internal/webhooks-preferences.yaml b/backend/openapi/components/schemas/internal/webhooks-preferences.yaml new file mode 100644 index 0000000..b2686ee --- /dev/null +++ b/backend/openapi/components/schemas/internal/webhooks-preferences.yaml @@ -0,0 +1,10 @@ +type: object +properties: + enabled: + type: boolean + example: true + description: Indicates whether webhooks are enabled or disabled. + url: + type: string + example: 'https://example.com/webhook' + description: The URL to which webhooks will be sent. This is only mandatory if webhooks are enabled. diff --git a/backend/openapi/components/schemas/meet-room-preferences.yaml b/backend/openapi/components/schemas/meet-room-preferences.yaml index 3dfd803..ec7d432 100644 --- a/backend/openapi/components/schemas/meet-room-preferences.yaml +++ b/backend/openapi/components/schemas/meet-room-preferences.yaml @@ -26,6 +26,15 @@ MeetRecordingPreferences: default: true example: true description: If true, the room will be allowed to record the video of the participants. + allowAccessTo: + type: string + enum: + - admin + - admin-moderator + - admin-moderator-publisher + - public + default: admin-moderator-publisher + example: admin-moderator-publisher MeetVirtualBackgroundPreferences: type: object properties: diff --git a/backend/openapi/openvidu-meet-internal-api.yaml b/backend/openapi/openvidu-meet-internal-api.yaml index 1511b54..530c78b 100644 --- a/backend/openapi/openvidu-meet-internal-api.yaml +++ b/backend/openapi/openvidu-meet-internal-api.yaml @@ -16,6 +16,12 @@ paths: $ref: './paths/internal/auth.yaml#/~1auth~1refresh' /auth/profile: $ref: './paths/internal/auth.yaml#/~1auth~1profile' + /preferences/webhooks: + $ref: './paths/internal/global-preferences.yaml#/~1preferences~1webhooks' + /preferences/security: + $ref: './paths/internal/global-preferences.yaml#/~1preferences~1security' + /preferences/appearance: + $ref: './paths/internal/global-preferences.yaml#/~1preferences~1appearance' /rooms/{roomId}: $ref: './paths/internal/rooms.yaml#/~1rooms~1{roomId}' /rooms/{roomId}/recording-token: @@ -43,6 +49,10 @@ components: schemas: User: $ref: components/schemas/internal/user.yaml + WebhooksPreferences: + $ref: components/schemas/internal/webhooks-preferences.yaml + SecurityPreferences: + $ref: components/schemas/internal/security-preferences.yaml MeetRoom: $ref: components/schemas/meet-room.yaml MeetRoomOptions: diff --git a/backend/openapi/paths/internal/global-preferences.yaml b/backend/openapi/paths/internal/global-preferences.yaml new file mode 100644 index 0000000..af18ed4 --- /dev/null +++ b/backend/openapi/paths/internal/global-preferences.yaml @@ -0,0 +1,103 @@ +/preferences/webhooks: + get: + operationId: getWebhooksPreferences + summary: Get webhooks preferences + description: > + Retrieves the webhooks preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + security: + - accessTokenCookie: [] + responses: + '200': + $ref: '../../components/responses/internal/success-get-webhooks-preferences.yaml' + '401': + $ref: '../../components/responses/unauthorized-error.yaml' + '403': + $ref: '../../components/responses/forbidden-error.yaml' + '500': + $ref: '../../components/responses/internal-server-error.yaml' + put: + operationId: updateWebhooksPreferences + summary: Update webhooks preferences + description: > + Updates the webhooks preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + security: + - accessTokenCookie: [] + requestBody: + $ref: '../../components/requestBodies/internal/update-webhooks-preferences.yaml' + responses: + '200': + $ref: '../../components/responses/internal/success-update-webhooks-preferences.yaml' + '401': + $ref: '../../components/responses/unauthorized-error.yaml' + '403': + $ref: '../../components/responses/forbidden-error.yaml' + '422': + $ref: '../../components/responses/validation-error.yaml' + '500': + $ref: '../../components/responses/internal-server-error.yaml' + +/preferences/security: + get: + operationId: getSecurityPreferences + summary: Get security preferences + description: > + Retrieves the security preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + responses: + '200': + $ref: '../../components/responses/internal/success-get-security-preferences.yaml' + '500': + $ref: '../../components/responses/internal-server-error.yaml' + put: + operationId: updateSecurityPreferences + summary: Update security preferences + description: > + Updates the security preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + security: + - accessTokenCookie: [] + requestBody: + $ref: '../../components/requestBodies/internal/update-security-preferences.yaml' + responses: + '200': + $ref: '../../components/responses/internal/success-update-security-preferences.yaml' + '401': + $ref: '../../components/responses/unauthorized-error.yaml' + '403': + $ref: '../../components/responses/forbidden-error.yaml' + '422': + $ref: '../../components/responses/validation-error.yaml' + '500': + $ref: '../../components/responses/internal-server-error.yaml' + +/preferences/appearance: + get: + operationId: getAppearancePreferences + summary: Get appearance preferences + description: > + Retrieves the appearance preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + security: + - accessTokenCookie: [] + responses: + '202': + $ref: '../../components/responses/pro-feature-error.yaml' + put: + operationId: updateAppearancePreferences + summary: Update appearance preferences + description: > + Updates the appearance preferences for the OpenVidu Meet application. + tags: + - Internal API - Global Preferences + security: + - accessTokenCookie: [] + responses: + '202': + $ref: '../../components/responses/pro-feature-error.yaml' diff --git a/backend/openapi/tags/tags.yaml b/backend/openapi/tags/tags.yaml index 3b1b231..5533753 100644 --- a/backend/openapi/tags/tags.yaml +++ b/backend/openapi/tags/tags.yaml @@ -4,6 +4,8 @@ description: Operations related to managing OpenVidu Meet recordings - name: Internal API - Authentication description: Authentication operations +- name: Internal API - Global Preferences + description: Operations related to managing global preferences in OpenVidu Meet - name: Internal API - Rooms description: Operations related to managing OpenVidu Meet rooms - name: Internal API - Participant