openapi: refactor authentication and user schemas to streamline properties

This commit is contained in:
juancarmore 2025-05-31 01:32:37 +02:00
parent 36cae89b37
commit 610c5276b0
2 changed files with 16 additions and 31 deletions

View File

@ -3,23 +3,11 @@ properties:
authentication: authentication:
$ref: '#/AuthenticationPreferences' $ref: '#/AuthenticationPreferences'
description: Preferences for authentication. description: Preferences for authentication.
roomCreationPolicy:
$ref: '#/RoomCreationPolicy'
description: Preferences for room creation policy.
AuthenticationPreferences: AuthenticationPreferences:
type: object type: object
properties: properties:
authMode: authMethod:
type: string
enum:
- none
- moderators_only
- all_users
default: none
example: none
description: The authentication mode to enter a room.
method:
type: object type: object
properties: properties:
type: type:
@ -29,17 +17,12 @@ AuthenticationPreferences:
default: single-user default: single-user
example: single-user example: single-user
description: The authentication method to use. description: The authentication method to use.
authModeToAccessRoom:
RoomCreationPolicy: type: string
type: object enum:
properties: - none
allowRoomCreation: - moderators_only
type: boolean - all_users
default: true default: none
example: true example: none
description: If true, users will be allowed to create rooms. description: The authentication mode to access a room.
requireAuthentication:
type: boolean
default: true
example: true
description: If true, users will be required to authenticate before creating rooms.

View File

@ -4,7 +4,9 @@ properties:
type: string type: string
example: 'admin' example: 'admin'
description: The username of the authenticated user. description: The username of the authenticated user.
role: roles:
type: string type: array
example: 'admin' items:
description: The role assigned to the authenticated user. type: string
example: ['admin', 'user']
description: A list of roles assigned to the authenticated user.