From 610c5276b0047d35588c27f2717dc602681c0839 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Sat, 31 May 2025 01:32:37 +0200 Subject: [PATCH] openapi: refactor authentication and user schemas to streamline properties --- .../internal/security-preferences.yaml | 37 +++++-------------- .../components/schemas/internal/user.yaml | 10 +++-- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/backend/openapi/components/schemas/internal/security-preferences.yaml b/backend/openapi/components/schemas/internal/security-preferences.yaml index ade41df..0889191 100644 --- a/backend/openapi/components/schemas/internal/security-preferences.yaml +++ b/backend/openapi/components/schemas/internal/security-preferences.yaml @@ -3,23 +3,11 @@ 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: + authMethod: type: object properties: type: @@ -29,17 +17,12 @@ AuthenticationPreferences: 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. + authModeToAccessRoom: + type: string + enum: + - none + - moderators_only + - all_users + default: none + example: none + description: The authentication mode to access a room. diff --git a/backend/openapi/components/schemas/internal/user.yaml b/backend/openapi/components/schemas/internal/user.yaml index 0623a92..706d401 100644 --- a/backend/openapi/components/schemas/internal/user.yaml +++ b/backend/openapi/components/schemas/internal/user.yaml @@ -4,7 +4,9 @@ properties: type: string example: 'admin' description: The username of the authenticated user. - role: - type: string - example: 'admin' - description: The role assigned to the authenticated user. + roles: + type: array + items: + type: string + example: ['admin', 'user'] + description: A list of roles assigned to the authenticated user.