From 0dceb40a6edb620091090d3d1adac2cf80a0442d Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:59:01 +0200 Subject: [PATCH] feat(api): add HTTP Basic Authentication fields to OpenAPI specifications and enhance PrivateKey model descriptions --- app/Models/PrivateKey.php | 4 ++-- openapi.json | 20 ++++++++++++++++++-- openapi.yaml | 13 +++++++++++++ routes/api.php | 1 - 4 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/Models/PrivateKey.php b/app/Models/PrivateKey.php index 97c32fa31..dbed7b439 100644 --- a/app/Models/PrivateKey.php +++ b/app/Models/PrivateKey.php @@ -17,8 +17,8 @@ use phpseclib3\Crypt\PublicKeyLoader; 'name' => ['type' => 'string'], 'description' => ['type' => 'string'], 'private_key' => ['type' => 'string', 'format' => 'private-key'], - 'public_key' => ['type' => 'string'], - 'fingerprint' => ['type' => 'string'], + 'public_key' => ['type' => 'string', 'description' => 'The public key of the private key.'], + 'fingerprint' => ['type' => 'string', 'description' => 'The fingerprint of the private key.'], 'is_git_related' => ['type' => 'boolean'], 'team_id' => ['type' => 'integer'], 'created_at' => ['type' => 'string'], diff --git a/openapi.json b/openapi.json index b48bd85e9..ccd7e2d83 100644 --- a/openapi.json +++ b/openapi.json @@ -7553,6 +7553,20 @@ "type": "string", "nullable": true, "description": "Custom Nginx configuration base64 encoded." + }, + "http_basic_auth_enabled": { + "type": "boolean", + "description": "HTTP Basic Authentication enabled." + }, + "http_basic_auth_username": { + "type": "string", + "nullable": true, + "description": "Username for HTTP Basic Authentication" + }, + "http_basic_auth_password": { + "type": "string", + "nullable": true, + "description": "Password for HTTP Basic Authentication" } }, "type": "object" @@ -7730,10 +7744,12 @@ "format": "private-key" }, "public_key": { - "type": "string" + "type": "string", + "description": "The public key of the private key." }, "fingerprint": { - "type": "string" + "type": "string", + "description": "The fingerprint of the private key." }, "is_git_related": { "type": "boolean" diff --git a/openapi.yaml b/openapi.yaml index 239da6820..41b1efdae 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5042,6 +5042,17 @@ components: type: string nullable: true description: 'Custom Nginx configuration base64 encoded.' + http_basic_auth_enabled: + type: boolean + description: 'HTTP Basic Authentication enabled.' + http_basic_auth_username: + type: string + nullable: true + description: 'Username for HTTP Basic Authentication' + http_basic_auth_password: + type: string + nullable: true + description: 'Password for HTTP Basic Authentication' type: object ApplicationDeploymentQueue: description: 'Project model' @@ -5161,8 +5172,10 @@ components: format: private-key public_key: type: string + description: 'The public key of the private key.' fingerprint: type: string + description: 'The fingerprint of the private key.' is_git_related: type: boolean team_id: diff --git a/routes/api.php b/routes/api.php index 405d8240e..8ac8aef14 100644 --- a/routes/api.php +++ b/routes/api.php @@ -93,7 +93,6 @@ Route::group([ Route::patch('/applications/{uuid}/envs/bulk', [ApplicationsController::class, 'create_bulk_envs'])->middleware(['api.ability:write']); Route::patch('/applications/{uuid}/envs', [ApplicationsController::class, 'update_env_by_uuid'])->middleware(['api.ability:write']); Route::delete('/applications/{uuid}/envs/{env_uuid}', [ApplicationsController::class, 'delete_env_by_uuid'])->middleware(['api.ability:write']); - // Route::post('/applications/{uuid}/execute', [ApplicationsController::class, 'execute_command_by_uuid'])->middleware(['ability:write']); Route::get('/applications/{uuid}/logs', [ApplicationsController::class, 'logs_by_uuid'])->middleware(['api.ability:read']); Route::match(['get', 'post'], '/applications/{uuid}/start', [ApplicationsController::class, 'action_deploy'])->middleware(['api.ability:write']);