feat: add API token authentication

This commit is contained in:
2025-05-03 23:04:47 +02:00
parent e62bbf8ca3
commit 1a0499d81f
6 changed files with 73 additions and 23 deletions

View File

@@ -8,6 +8,17 @@ servers:
- url: http://localhost:8080
description: Local development server
components:
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Token
description: API token for authentication
security:
- ApiKeyAuth: []
paths:
/health:
get:
@@ -57,6 +68,8 @@ paths:
description: Network interface brought up successfully
'400':
description: Invalid request payload
'401':
description: Unauthorized - invalid or missing API token
'500':
description: Internal server error
@@ -82,6 +95,8 @@ paths:
description: Network interface brought down successfully
'400':
description: Invalid request payload
'401':
description: Unauthorized - invalid or missing API token
'500':
description: Internal server error
@@ -92,6 +107,8 @@ paths:
responses:
'200':
description: Connection profile removed successfully
'401':
description: Unauthorized - invalid or missing API token
'500':
description: Internal server error
@@ -108,6 +125,8 @@ paths:
type: string
description: Current hostname
example: "MyHostname"
'401':
description: Unauthorized - invalid or missing API token
'500':
description: Internal server error
post:
@@ -131,6 +150,7 @@ paths:
description: Hostname set successfully
'400':
description: Invalid request payload
'401':
description: Unauthorized - invalid or missing API token
'500':
description: Internal server error