diff --git a/composer.lock b/composer.lock index a155f3f68b..4a06e7b02a 100644 --- a/composer.lock +++ b/composer.lock @@ -3850,16 +3850,16 @@ }, { "name": "utopia-php/database", - "version": "5.4.1", + "version": "5.4.2", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "688d9422b5ff42ac2ecc29397d94891cfd772e93" + "reference": "a1bb3e2a4fba13032ea625b21a21039c43cffeda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/688d9422b5ff42ac2ecc29397d94891cfd772e93", - "reference": "688d9422b5ff42ac2ecc29397d94891cfd772e93", + "url": "https://api.github.com/repos/utopia-php/database/zipball/a1bb3e2a4fba13032ea625b21a21039c43cffeda", + "reference": "a1bb3e2a4fba13032ea625b21a21039c43cffeda", "shasum": "" }, "require": { @@ -3903,9 +3903,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/5.4.1" + "source": "https://github.com/utopia-php/database/tree/5.4.2" }, - "time": "2026-04-29T07:32:59+00:00" + "time": "2026-04-30T09:59:57+00:00" }, { "name": "utopia-php/detector", @@ -4530,16 +4530,16 @@ }, { "name": "utopia-php/migration", - "version": "1.9.5", + "version": "1.9.6", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "952a4dfe232702f80e45c35129466a8d8cb4c599" + "reference": "b164631404ec759f8c368fe2321f44c22bc258ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/952a4dfe232702f80e45c35129466a8d8cb4c599", - "reference": "952a4dfe232702f80e45c35129466a8d8cb4c599", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/b164631404ec759f8c368fe2321f44c22bc258ab", + "reference": "b164631404ec759f8c368fe2321f44c22bc258ab", "shasum": "" }, "require": { @@ -4579,9 +4579,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.9.5" + "source": "https://github.com/utopia-php/migration/tree/1.9.6" }, - "time": "2026-04-29T11:19:13+00:00" + "time": "2026-04-30T08:11:07+00:00" }, { "name": "utopia-php/mongo", diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php index 67c1ec3050..6a5a62f14f 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Deployment.php @@ -544,18 +544,28 @@ trait Deployment if ($e->getType() === Exception::PROJECT_NOT_FOUND) { Console::warning("Skipping repository '{$repositoryId}': project '{$projectId}' not found"); } else { - $errors[] = $e->getMessage(); + $errors[] = $e; } } catch (\Throwable $e) { Span::add("{$logBase}.error", $e->getMessage()); - $errors[] = $e->getMessage(); + $errors[] = $e; } } $queueForBuilds->reset(); // prevent shutdown hook from triggering again if (!empty($errors)) { - throw new Exception(Exception::GENERAL_UNKNOWN, \implode("\n", $errors)); + foreach ($errors as $error) { + if ($error instanceof Exception && $error->getCode() >= 500) { + throw $error; + } + } + foreach ($errors as $error) { + if ($error instanceof Exception && $error->getCode() >= 400) { + throw $error; + } + } + throw new Exception(Exception::GENERAL_UNKNOWN); } } diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 82020b05b1..c8120bd017 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -163,6 +163,12 @@ class Specs extends Action 'description' => 'Your secret dev API key', 'in' => 'header', ], + 'Cookie' => [ + 'type' => 'apiKey', + 'name' => 'Cookie', + 'description' => 'The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.', + 'in' => 'header', + ], 'ImpersonateUserId' => [ 'type' => 'apiKey', 'name' => 'X-Appwrite-Impersonate-User-Id', @@ -219,6 +225,18 @@ class Specs extends Action 'description' => 'The user agent string of the client that made the request', 'in' => 'header', ], + 'DevKey' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Dev-Key', + 'description' => 'Your secret dev API key', + 'in' => 'header', + ], + 'Cookie' => [ + 'type' => 'apiKey', + 'name' => 'Cookie', + 'description' => 'The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.', + 'in' => 'header', + ], 'ImpersonateUserId' => [ 'type' => 'apiKey', 'name' => 'X-Appwrite-Impersonate-User-Id', @@ -272,7 +290,19 @@ class Specs extends Action 'Cookie' => [ 'type' => 'apiKey', 'name' => 'Cookie', - 'description' => 'The user cookie to authenticate with', + 'description' => 'The user cookie to authenticate with. Used by SDKs that forward an incoming Cookie header in server-side runtimes.', + 'in' => 'header', + ], + 'Session' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Session', + 'description' => 'The user session to authenticate with', + 'in' => 'header', + ], + 'DevKey' => [ + 'type' => 'apiKey', + 'name' => 'X-Appwrite-Dev-Key', + 'description' => 'Your secret dev API key', 'in' => 'header', ], 'ImpersonateUserId' => [ diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 69f72b8e27..c25a83c231 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -338,6 +338,55 @@ class Migrations extends Action ); } + /** + * @return array + */ + protected function getAPIKeyScopes(): array + { + return [ + 'users.read', + 'users.write', + 'teams.read', + 'teams.write', + 'buckets.read', + 'buckets.write', + 'files.read', + 'files.write', + 'functions.read', + 'functions.write', + 'sites.read', + 'sites.write', + 'tokens.read', + 'tokens.write', + 'providers.read', + 'providers.write', + 'topics.read', + 'topics.write', + 'subscribers.read', + 'subscribers.write', + 'messages.read', + 'messages.write', + 'targets.read', + 'targets.write', + 'webhooks.read', + 'webhooks.write', + 'project.read', + 'project.write', + 'keys.read', + 'keys.write', + 'platforms.read', + 'platforms.write', + 'oauth2.read', + 'oauth2.write', + 'mocks.read', + 'mocks.write', + 'policies.read', + 'policies.write', + 'templates.read', + 'templates.write', + ]; + } + /** * @throws Exception */ @@ -358,48 +407,7 @@ class Migrations extends Action METRIC_NETWORK_INBOUND, METRIC_NETWORK_OUTBOUND, ], - 'scopes' => [ - 'users.read', - 'users.write', - 'teams.read', - 'teams.write', - 'buckets.read', - 'buckets.write', - 'files.read', - 'files.write', - 'functions.read', - 'functions.write', - 'sites.read', - 'sites.write', - 'tokens.read', - 'tokens.write', - 'providers.read', - 'providers.write', - 'topics.read', - 'topics.write', - 'subscribers.read', - 'subscribers.write', - 'messages.read', - 'messages.write', - 'targets.read', - 'targets.write', - 'webhooks.read', - 'webhooks.write', - 'project.read', - 'project.write', - 'keys.read', - 'keys.write', - 'platforms.read', - 'platforms.write', - 'oauth2.read', - 'oauth2.write', - 'mocks.read', - 'mocks.write', - 'policies.read', - 'policies.write', - 'templates.read', - 'templates.write', - ] + 'scopes' => $this->getAPIKeyScopes(), ]); return API_KEY_EPHEMERAL . '_' . $apiKey;