diff --git a/backend/openapi/components/requestBodies/internal/create-api-key.yaml b/backend/openapi/components/requestBodies/internal/create-api-key.yaml deleted file mode 100644 index 9ab44aa..0000000 --- a/backend/openapi/components/requestBodies/internal/create-api-key.yaml +++ /dev/null @@ -1,19 +0,0 @@ -description: Create a new API key. -required: true -content: - application/json: - schema: - type: object - properties: - apiKey: - type: string - description: The API key to be created. - example: "ovmeet-1234567890abcdef1234567890abcdef" - creationDate: - type: string - format: date-time - description: The date and time when the API key was created. - example: "2023-10-01T12:00:00Z" - required: - - apiKey - additionalProperties: false \ No newline at end of file diff --git a/backend/openapi/components/responses/internal/success-create-api-key.yaml b/backend/openapi/components/responses/internal/success-create-api-key.yaml new file mode 100644 index 0000000..ec99c0b --- /dev/null +++ b/backend/openapi/components/responses/internal/success-create-api-key.yaml @@ -0,0 +1,14 @@ +description: Successfully created a new API key +content: + application/json: + schema: + type: object + properties: + apiKey: + type: string + description: The API key that was created. + example: 'ovmeet-1234567890abcdef1234567890abcdef' + creationDate: + type: number + description: The date when the API key was created. + example: 1620000000000 diff --git a/backend/openapi/components/responses/internal/success-get-api-keys.yaml b/backend/openapi/components/responses/internal/success-get-api-keys.yaml new file mode 100644 index 0000000..7511364 --- /dev/null +++ b/backend/openapi/components/responses/internal/success-get-api-keys.yaml @@ -0,0 +1,16 @@ +description: Successfully retrieved API keys +content: + application/json: + schema: + type: array + items: + type: object + properties: + apiKey: + type: string + description: The API key that was created. + example: 'ovmeet-1234567890abcdef1234567890abcdef' + creationDate: + type: number + description: The date when the API key was created. + example: 1620000000000 diff --git a/backend/openapi/paths/internal/auth.yaml b/backend/openapi/paths/internal/auth.yaml index 6140feb..f7b31b5 100644 --- a/backend/openapi/paths/internal/auth.yaml +++ b/backend/openapi/paths/internal/auth.yaml @@ -67,7 +67,7 @@ /auth/api-keys: post: operationId: createApiKey - summary: Create an API key + summary: Create a new API key description: > Creates a new API key. Only one API key can be created in the system. If an API key already exists, it will be replaced with the new one. @@ -76,18 +76,14 @@ - Internal API - Authentication security: - accessTokenCookie: [] - requestBody: - $ref: '../../components/requestBodies/internal/create-api-key.yaml' responses: '201': $ref: '../../components/responses/internal/success-create-api-key.yaml' - '400': - $ref: '../../components/responses/internal/error-invalid-request.yaml' '500': $ref: '../../components/responses/internal-server-error.yaml' get: operationId: getApiKeys - summary: Get the API keys + summary: Get API keys description: > Retrieves the existing API keys. tags: @@ -96,12 +92,12 @@ - accessTokenCookie: [] responses: '200': - $ref: '../../components/responses/internal/success-get-api-key.yaml' + $ref: '../../components/responses/internal/success-get-api-keys.yaml' '500': $ref: '../../components/responses/internal-server-error.yaml' delete: operationId: deleteApiKeys - summary: Delete the API keys + summary: Delete API keys description: > Deletes the existing API keys. tags: