From 607ef095193c606d1e36664c914735d35968383f Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 18:13:46 +0530 Subject: [PATCH 01/18] [TEMP/TESTING] Add Bitbucket as a VCS provider Adds Bitbucket alongside GitHub/GitLab/Gitea, OAuth-token-based like GitLab (no App-installation concept): - OAuth2\Bitbucket: getUserSlug() (username ?? nickname -- required by Callback\Base, which aborts the install if empty) and createRepository() with an optional namespaceId (target workspace, since Bitbucket has no implicit "current user's namespace" the way GitHub/GitLab do -- the workspace is always part of the URL). - app/config/vcs.php: registers 'bitbucket'. Deliberately no 'endpoint' key -- Factory feeds it to setEndpoint(), which for Bitbucket sets the API base (api.bitbucket.org), not the browser host, unlike GitLab where the same mechanism sets the browser host. - 3 new Http/Bitbucket/{Authorize,Callback,Events} controllers, mirroring GitLab's. Events/Create.php calls getEvents() (plural) and loops, not getEvent() -- Bitbucket batches every ref a push touched into one delivery, and the singular method only reports the first. - Installations/Namespaces/XList.php: listNamespaces() is now declared on the abstract Git class with a throwing default rather than being adapter-specific, so method_exists() is always true. Switched to try/catch so unsupported providers (Bitbucket, GitHub, Gitea) still fall back to wrapping the installation's own owner as a single namespace. - constants.php, variables.php, .env, docker-compose.yml: the usual per-provider plumbing (APP_VCS_BITBUCKET_EMAIL, 3 env vars). TEMP: composer.json points utopia-php/vcs at the unreleased feat-bitbucket-adapter branch (utopia-php/vcs#125) for testing this end to end before either side is a real release. --- .env | 3 + app/config/variables.php | 27 ++ app/config/vcs.php | 16 + app/init/constants.php | 1 + composer.json | 2 +- composer.lock | 26 +- docker-compose.yml | 6 + src/Appwrite/Auth/OAuth2/Bitbucket.php | 68 +++++ .../VCS/Http/Bitbucket/Authorize/Get.php | 42 +++ .../VCS/Http/Bitbucket/Callback/Get.php | 35 +++ .../VCS/Http/Bitbucket/Events/Create.php | 273 ++++++++++++++++++ .../Http/Installations/Namespaces/XList.php | 8 +- .../Platform/Modules/VCS/Services/Http.php | 8 + 13 files changed, 503 insertions(+), 12 deletions(-) create mode 100644 src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Authorize/Get.php create mode 100644 src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Callback/Get.php create mode 100644 src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Events/Create.php diff --git a/.env b/.env index df725cc8df..57ab825d22 100644 --- a/.env +++ b/.env @@ -165,5 +165,8 @@ _APP_VCS_GITEA_WEBHOOK_SECRET=gitea-webhook-secret _APP_VCS_GITLAB_CLIENT_ID= _APP_VCS_GITLAB_CLIENT_SECRET= _APP_VCS_GITLAB_WEBHOOK_SECRET= +_APP_VCS_BITBUCKET_CLIENT_ID= +_APP_VCS_BITBUCKET_CLIENT_SECRET= +_APP_VCS_BITBUCKET_WEBHOOK_SECRET= _APP_VCS_WEBHOOK_URL=http://appwrite/v1 _APP_WEBHOOK_MAX_FAILED_ATTEMPTS=10 diff --git a/app/config/variables.php b/app/config/variables.php index 789890ae55..acc799128c 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -1329,6 +1329,33 @@ return [ 'question' => '', 'filter' => '' ], + [ + 'name' => '_APP_VCS_BITBUCKET_CLIENT_ID', + 'description' => 'Bitbucket OAuth2 consumer key. You can generate one in your Bitbucket workspace under Settings > OAuth consumers.', + 'introduction' => '2.0.0', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_VCS_BITBUCKET_CLIENT_SECRET', + 'description' => 'Bitbucket OAuth2 consumer secret. You can generate one in your Bitbucket workspace under Settings > OAuth consumers.', + 'introduction' => '2.0.0', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], + [ + 'name' => '_APP_VCS_BITBUCKET_WEBHOOK_SECRET', + 'description' => 'Secret used to validate incoming Bitbucket webhook payloads.', + 'introduction' => '2.0.0', + 'default' => '', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_VCS_WEBHOOK_URL', 'description' => 'Base URL Appwrite advertises to self-hosted VCS providers when registering repository webhooks, if different from the public domain (e.g. a Docker-internal address). Falls back to the public domain when unset.', diff --git a/app/config/vcs.php b/app/config/vcs.php index f32d95acc8..d3a5dc8279 100644 --- a/app/config/vcs.php +++ b/app/config/vcs.php @@ -4,9 +4,11 @@ * VCS provider registry, read by Appwrite\Vcs\Factory. */ +use Appwrite\Auth\OAuth2\Bitbucket as OAuth2Bitbucket; use Appwrite\Auth\OAuth2\Gitea as OAuth2Gitea; use Appwrite\Auth\OAuth2\Github as OAuth2Github; use Appwrite\Auth\OAuth2\Gitlab as OAuth2Gitlab; +use Utopia\VCS\Adapter\Git\Bitbucket; use Utopia\VCS\Adapter\Git\Gitea; use Utopia\VCS\Adapter\Git\GitHub; use Utopia\VCS\Adapter\Git\GitLab; @@ -60,4 +62,18 @@ return [ 'webhookSecret' => ['required' => true, 'envVariable' => '_APP_VCS_GITLAB_WEBHOOK_SECRET'], ], ], + 'bitbucket' => [ + 'adapter' => Bitbucket::class, + 'oauth2' => fn (string $clientId, string $clientSecret, string $endpoint) => new OAuth2Bitbucket($clientId, $clientSecret, ''), + // Only official bitbucket.org/api.bitbucket.org is supported -- fixed, + // not configurable. Deliberately no 'endpoint' key here: unlike + // GitLab's, Bitbucket's setEndpoint() sets the API base + // (api.bitbucket.org), not the browser host, so this must stay unset + // rather than pointed at the wrong host. + 'variables' => [ + 'clientId' => ['required' => true, 'envVariable' => '_APP_VCS_BITBUCKET_CLIENT_ID'], + 'clientSecret' => ['required' => true, 'envVariable' => '_APP_VCS_BITBUCKET_CLIENT_SECRET'], + 'webhookSecret' => ['required' => true, 'envVariable' => '_APP_VCS_BITBUCKET_WEBHOOK_SECRET'], + ], + ], ]; diff --git a/app/init/constants.php b/app/init/constants.php index b12d7997a6..ae63253e43 100644 --- a/app/init/constants.php +++ b/app/init/constants.php @@ -113,6 +113,7 @@ const APP_VCS_GITHUB_EMAIL = 'team@appwrite.io'; const APP_VCS_GITHUB_URL = 'https://github.com/TeamAppwrite'; const APP_VCS_GITEA_EMAIL = 'team@appwrite.io'; // Used to detect Appwrite's own commits const APP_VCS_GITLAB_EMAIL = 'team@appwrite.io'; // Used to detect Appwrite's own commits +const APP_VCS_BITBUCKET_EMAIL = 'team@appwrite.io'; // Used to detect Appwrite's own commits const APP_BRANDED_EMAIL_BASE_TEMPLATE = 'email-base-styled'; // Embeddings diff --git a/composer.json b/composer.json index c0c528c006..b4e2a533e2 100644 --- a/composer.json +++ b/composer.json @@ -100,7 +100,7 @@ "utopia-php/telemetry": "^0.4", "utopia-php/user-agent": "0.1.*", "mustangostang/spyc": "0.6.*", - "utopia-php/vcs": "4.*.*", + "utopia-php/vcs": "dev-feat-bitbucket-adapter as 4.4.5", "utopia-php/websocket": "1.0.*", "dragonmantank/cron-expression": "3.4.*", "phpmailer/phpmailer": "6.9.*", diff --git a/composer.lock b/composer.lock index 700bc30981..01e279706f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a811ab43bece6d9d01be1caab8a08a75", + "content-hash": "cab65b8eda5337aa42124ce6c76ffd51", "packages": [ { "name": "adhocore/jwt", @@ -5160,16 +5160,16 @@ }, { "name": "utopia-php/vcs", - "version": "4.4.5", + "version": "dev-feat-bitbucket-adapter", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "4abcc51d113697fb45ad7fab83851bc4162c6bd4" + "reference": "dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/4abcc51d113697fb45ad7fab83851bc4162c6bd4", - "reference": "4abcc51d113697fb45ad7fab83851bc4162c6bd4", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b", + "reference": "dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b", "shasum": "" }, "require": { @@ -5220,10 +5220,10 @@ "vcs" ], "support": { - "source": "https://github.com/utopia-php/vcs/tree/4.4.5", + "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-23T13:01:07+00:00" + "time": "2026-07-30T12:06:14+00:00" }, { "name": "utopia-php/websocket", @@ -8407,11 +8407,19 @@ "time": "2026-07-03T20:44:34+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "utopia-php/vcs", + "version": "dev-feat-bitbucket-adapter", + "alias": "4.4.5", + "alias_normalized": "4.4.5.0" + } + ], "minimum-stability": "dev", "stability-flags": { "utopia-php/http": 5, - "utopia-php/platform": 5 + "utopia-php/platform": 5, + "utopia-php/vcs": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/docker-compose.yml b/docker-compose.yml index e78d013fcc..cd8d8a662d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -205,6 +205,9 @@ services: - _APP_VCS_GITLAB_CLIENT_ID - _APP_VCS_GITLAB_CLIENT_SECRET - _APP_VCS_GITLAB_WEBHOOK_SECRET + - _APP_VCS_BITBUCKET_CLIENT_ID + - _APP_VCS_BITBUCKET_CLIENT_SECRET + - _APP_VCS_BITBUCKET_WEBHOOK_SECRET - _APP_VCS_WEBHOOK_URL - _APP_MIGRATIONS_FIREBASE_CLIENT_ID - _APP_MIGRATIONS_FIREBASE_CLIENT_SECRET @@ -499,6 +502,9 @@ services: - _APP_VCS_GITLAB_CLIENT_ID - _APP_VCS_GITLAB_CLIENT_SECRET - _APP_VCS_GITLAB_WEBHOOK_SECRET + - _APP_VCS_BITBUCKET_CLIENT_ID + - _APP_VCS_BITBUCKET_CLIENT_SECRET + - _APP_VCS_BITBUCKET_WEBHOOK_SECRET - _APP_VCS_WEBHOOK_URL - _APP_FUNCTIONS_TIMEOUT - _APP_SITES_TIMEOUT diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 361bc22b65..d20207c7f6 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -152,6 +152,74 @@ class Bitbucket extends OAuth2 return $user['display_name'] ?? ''; } + /** + * Bitbucket's `/user` response carries `username` for older accounts and + * `nickname` for accounts migrated to Atlassian identity, which don't + * expose one. Callers (repository creation, ownership resolution) need + * whichever of the two the account actually has. + * + * @param string $accessToken + * + * @return string + */ + public function getUserSlug(string $accessToken): string + { + $user = $this->getUser($accessToken); + + return $user['username'] ?? ($user['nickname'] ?? ''); + } + + /** + * @link https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post + * + * Bitbucket has no implicit "current user's default namespace" the way + * GitHub/GitLab do -- the workspace is always part of the URL. Defaults + * to the token owner's own workspace (their user slug) when no + * $namespaceId (a workspace slug) is given. + * + * @param string $accessToken + * @param string $repositoryName + * @param bool $private + * @param string $namespaceId + * + * @return array + */ + public function createRepository(string $accessToken, string $repositoryName, bool $private, string $namespaceId = ''): array + { + $workspace = !empty($namespaceId) ? $namespaceId : $this->getUserSlug($accessToken); + + $repository = $this->request( + 'POST', + 'https://api.bitbucket.org/2.0/repositories/' . \rawurlencode($workspace) . '/' . \rawurlencode($repositoryName), + ['Authorization: Bearer ' . $accessToken, 'Content-Type: application/json'], + \json_encode([ + 'scm' => 'git', + 'is_private' => $private, + ]) + ); + + $repository = \json_decode($repository, true) ?? []; + + // Normalize to the GitHub/Gitea/GitLab field shape ProviderRepository expects. + if (isset($repository['uuid'])) { + $repository['id'] = $repository['uuid']; + } + + if (isset($repository['is_private'])) { + $repository['private'] = $repository['is_private']; + } + + if (isset($repository['updated_on'])) { + $repository['pushed_at'] = $repository['updated_on']; + } + + if (isset($repository['error']['message']) && !isset($repository['message'])) { + $repository['message'] = $repository['error']['message']; + } + + return $repository; + } + /** * @param string $accessToken * diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Authorize/Get.php b/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Authorize/Get.php new file mode 100644 index 0000000000..586bd0fec3 --- /dev/null +++ b/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Authorize/Get.php @@ -0,0 +1,42 @@ +setHttpMethod(Action::HTTP_REQUEST_METHOD_POST) + ->setHttpPath('/v1/vcs/bitbucket/events') + ->desc('Create event') + ->groups(['api', 'vcs']) + ->label('scope', 'public') + ->inject('vcsFactory') + ->inject('vcsWebhookSecret') + ->inject('installationTokens') + ->inject('request') + ->inject('response') + ->inject('dbForPlatform') + ->inject('authorization') + ->inject('getProjectDB') + ->inject('deploymentsFactory') + ->inject('platform') + ->callback($this->action(...)); + } + + public function action( + VcsFactory $vcsFactory, + callable $vcsWebhookSecret, + InstallationTokens $installationTokens, + Request $request, + Response $response, + Database $dbForPlatform, + Authorization $authorization, + callable $getProjectDB, + callable $deploymentsFactory, + array $platform + ) { + $vcs = $vcsFactory->fromProvider('bitbucket'); + + $event = $request->getHeaderLine($vcs->getEventHeaderName(), ''); + Span::add('vcs.bitbucket.event.name', $event); + + $payload = $request->getRawPayload(); + $signature = $request->getHeaderLine($vcs->getSignatureHeaderName(), ''); + $secretKey = $vcsWebhookSecret('bitbucket'); + + $valid = !empty($secretKey) && $vcs->validateWebhookEvent($payload, $signature, $secretKey); + Span::add('vcs.bitbucket.event.signature.valid', $valid); + + if (!$valid) { + throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Invalid webhook payload signature. Please make sure the webhook secret has same value in your Bitbucket repository settings and in the _APP_VCS_BITBUCKET_WEBHOOK_SECRET environment variable'); + } + + // A single push delivery can batch several branches; getEvent() would + // only report the first, silently dropping the rest, so every parsed + // event from the delivery is handled. + $parsedPayloads = $vcs->getEvents($event, $payload); + + foreach ($parsedPayloads as $parsedPayload) { + match ($event) { + 'repo:push' => $this->handlePushEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + 'pullrequest:created', 'pullrequest:updated', 'pullrequest:fulfilled', 'pullrequest:rejected' => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + default => null, + }; + } + + $response->json(['events' => $parsedPayloads]); + } + + private function resolveBitbucketInstallation(Document $repository, Database $dbForPlatform, Authorization $authorization): ?Document + { + $installation = $authorization->skip(fn () => $dbForPlatform->getDocument('installations', $repository->getAttribute('installationId', ''))); + + if ($installation->isEmpty() || $installation->getAttribute('provider', 'github') !== 'bitbucket') { + return null; + } + + return $installation; + } + + /** + * A refresh/adapter failure is pushed onto $errors instead of swallowed, so the + * caller can surface a non-2xx response and Bitbucket logs it as a failed delivery. + */ + private function resolveAdapterForRepository(Document $repository, VcsFactory $vcsFactory, InstallationTokens $installationTokens, Database $dbForPlatform, Authorization $authorization, array &$errors): ?Git + { + $installation = $this->resolveBitbucketInstallation($repository, $dbForPlatform, $authorization); + + if ($installation === null) { + return null; + } + + try { + $installation = $installationTokens->refreshForInstallation($installation, $dbForPlatform, $vcsFactory); + + return $vcsFactory->fromInstallation($installation); + } catch (\Throwable $error) { + $message = "Failed to resolve Bitbucket adapter for installation '{$installation->getId()}': " . $error->getMessage(); + Console::warning($message); + Span::add("vcs.bitbucket.event.installation.{$installation->getId()}.error", $message); + $errors[] = $message; + return null; + } + } + + private function handlePushEvent( + array $parsedPayload, + VcsFactory $vcsFactory, + InstallationTokens $installationTokens, + Database $dbForPlatform, + Authorization $authorization, + callable $getProjectDB, + array $platform, + callable $deploymentsFactory, + ) { + $providerBranchDeleted = $parsedPayload['branchDeleted'] ?? false; + $providerBranch = $parsedPayload['branch'] ?? ''; + $providerBranchUrl = $parsedPayload['branchUrl'] ?? ''; + $providerRepositoryId = $parsedPayload['repositoryId'] ?? ''; + $providerRepositoryName = $parsedPayload['repositoryName'] ?? ''; + $providerRepositoryUrl = $parsedPayload['repositoryUrl'] ?? ''; + $providerCommitHash = $parsedPayload['commitHash'] ?? ''; + $providerRepositoryOwner = $parsedPayload['owner'] ?? ''; + $providerCommitAuthorName = $parsedPayload['headCommitAuthorName'] ?? ''; + $providerCommitAuthorEmail = $parsedPayload['headCommitAuthorEmail'] ?? ''; + $providerCommitAuthorUrl = $parsedPayload['authorUrl'] ?? ''; + $providerCommitMessage = $parsedPayload['headCommitMessage'] ?? ''; + $providerCommitUrl = $parsedPayload['headCommitUrl'] ?? ''; + + Span::add('vcs.bitbucket.event.repo.id', $providerRepositoryId); + Span::add('vcs.bitbucket.event.repo.name', $providerRepositoryName); + Span::add('vcs.bitbucket.event.branch', $providerBranch); + + if ($providerCommitAuthorEmail === APP_VCS_BITBUCKET_EMAIL || $providerBranchDeleted) { + return; + } + + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ + Query::equal('providerRepositoryId', [$providerRepositoryId]), + Query::limit(100), + ])); + + $providerAffectedFiles = $parsedPayload['affectedFiles'] ?? []; + + $errors = []; + foreach ($repositories as $repository) { + $adapter = $this->resolveAdapterForRepository($repository, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $errors); + + if ($adapter === null) { + continue; + } + + $providerInstallationId = $repository->getAttribute('installationId', ''); + + $this->createGitDeployments($adapter, $providerInstallationId, [$repository], $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthorName, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, '', $providerAffectedFiles, false, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory); + } + + if (!empty($errors)) { + throw new Exception(Exception::GENERAL_UNKNOWN, \implode("\n", $errors)); + } + } + + private function handlePullRequestEvent( + array $parsedPayload, + VcsFactory $vcsFactory, + InstallationTokens $installationTokens, + Database $dbForPlatform, + Authorization $authorization, + callable $getProjectDB, + array $platform, + callable $deploymentsFactory, + ) { + $action = $parsedPayload['action'] ?? ''; + + if ($action === 'opened' || $action === 'reopened' || $action === 'synchronize') { + $providerBranch = $parsedPayload['branch'] ?? ''; + $providerBranchUrl = $parsedPayload['branchUrl'] ?? ''; + $providerRepositoryId = $parsedPayload['repositoryId'] ?? ''; + $providerRepositoryName = $parsedPayload['repositoryName'] ?? ''; + $providerRepositoryUrl = $parsedPayload['repositoryUrl'] ?? ''; + $providerPullRequestId = $parsedPayload['pullRequestNumber'] ?? ''; + $providerCommitHash = $parsedPayload['commitHash'] ?? ''; + $providerRepositoryOwner = $parsedPayload['owner'] ?? ''; + $external = $parsedPayload['external'] ?? true; + $providerCommitUrl = $parsedPayload['headCommitUrl'] ?? ''; + $providerCommitAuthorUrl = $parsedPayload['authorUrl'] ?? ''; + + Span::add('vcs.bitbucket.event.repo.id', $providerRepositoryId); + Span::add('vcs.bitbucket.event.repo.name', $providerRepositoryName); + Span::add('vcs.bitbucket.event.branch', $providerBranch); + + // Ignore sync for non-external. We handle it in the push webhook. + if (!$external && $action === 'synchronize') { + return; + } + + $repositories = $authorization->skip(fn () => $dbForPlatform->find('repositories', [ + Query::equal('providerRepositoryId', [$providerRepositoryId]), + Query::orderDesc('$createdAt'), + Query::limit(100), + ])); + + $errors = []; + foreach ($repositories as $repository) { + $adapter = $this->resolveAdapterForRepository($repository, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $errors); + + if ($adapter === null) { + continue; + } + + $providerInstallationId = $repository->getAttribute('installationId', ''); + + try { + $commitDetails = $adapter->getCommit($providerRepositoryOwner, $providerRepositoryName, $providerCommitHash); + } catch (\Throwable $e) { + Console::warning("Failed to fetch commit '{$providerCommitHash}': " . $e->getMessage()); + $commitDetails = []; + } + $providerCommitAuthor = $commitDetails['commitAuthor'] ?? ''; + $providerCommitMessage = $commitDetails['commitMessage'] ?? ''; + + $prFiles = $adapter->getPullRequestFiles($providerRepositoryOwner, $providerRepositoryName, $providerPullRequestId); + $providerAffectedFiles = [ + ...array_column($prFiles, 'filename'), + ...array_filter(array_column($prFiles, 'previous_filename')), + ]; + + $this->createGitDeployments($adapter, $providerInstallationId, [$repository], $providerBranch, $providerBranchUrl, $providerRepositoryName, $providerRepositoryUrl, $providerRepositoryOwner, $providerCommitHash, $providerCommitAuthor, $providerCommitAuthorUrl, $providerCommitMessage, $providerCommitUrl, $providerPullRequestId, $providerAffectedFiles, $external, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory); + } + + if (!empty($errors)) { + throw new Exception(Exception::GENERAL_UNKNOWN, \implode("\n", $errors)); + } + } elseif ($action === 'closed') { + $providerRepositoryId = $parsedPayload['repositoryId'] ?? ''; + $providerPullRequestId = $parsedPayload['pullRequestNumber'] ?? ''; + $external = $parsedPayload['external'] ?? true; + + if (!$external) { + return; + } + + (new RepositoryPullRequestCleanup())->remove($dbForPlatform, $authorization, 'bitbucket', $providerRepositoryId, $providerPullRequestId); + } + } +} diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Namespaces/XList.php b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Namespaces/XList.php index 62b9172bc0..1fb4bed76e 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Installations/Namespaces/XList.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Installations/Namespaces/XList.php @@ -97,7 +97,11 @@ class XList extends Action $page = ($offset / $limit) + 1; - if (\method_exists($vcs, 'listNamespaces')) { + // listNamespaces() is declared on the abstract Git class with a + // throwing default, not omitted -- method_exists() is always true, + // so unsupported providers (Bitbucket, GitHub, Gitea) are detected by + // catching the exception, not by checking for the method. + try { ['items' => $namespaces, 'total' => $total] = $vcs->listNamespaces($page, $limit, $search); $namespaces = \array_map(fn ($namespace) => [ '$id' => $namespace['id'] ?? '', @@ -106,7 +110,7 @@ class XList extends Action 'type' => ($namespace['kind'] ?? '') === 'user' ? 'user' : 'organization', 'avatarUrl' => $namespace['avatarUrl'] ?? '', ], $namespaces); - } else { + } catch (\Throwable) { $providerInstallationId = $installation->getAttribute('providerInstallationId', ''); $owner = $vcs->getOwnerName($providerInstallationId); $matches = empty($search) || \stripos($owner, $search) !== false; diff --git a/src/Appwrite/Platform/Modules/VCS/Services/Http.php b/src/Appwrite/Platform/Modules/VCS/Services/Http.php index 063be6bd9d..e078c8fca0 100644 --- a/src/Appwrite/Platform/Modules/VCS/Services/Http.php +++ b/src/Appwrite/Platform/Modules/VCS/Services/Http.php @@ -2,6 +2,9 @@ namespace Appwrite\Platform\Modules\VCS\Services; +use Appwrite\Platform\Modules\VCS\Http\Bitbucket\Authorize\Get as GetBitbucketAuthorize; +use Appwrite\Platform\Modules\VCS\Http\Bitbucket\Callback\Get as GetBitbucketCallback; +use Appwrite\Platform\Modules\VCS\Http\Bitbucket\Events\Create as CreateBitbucketEvent; use Appwrite\Platform\Modules\VCS\Http\Gitea\Authorize\Get as GetGiteaAuthorize; use Appwrite\Platform\Modules\VCS\Http\Gitea\Callback\Get as GetGiteaCallback; use Appwrite\Platform\Modules\VCS\Http\Gitea\Events\Create as CreateGiteaEvent; @@ -43,6 +46,10 @@ class Http extends Service $this->addAction(GetGitlabAuthorize::getName(), new GetGitlabAuthorize()); $this->addAction(GetGitlabCallback::getName(), new GetGitlabCallback()); + // Bitbucket Authorization & Callback + $this->addAction(GetBitbucketAuthorize::getName(), new GetBitbucketAuthorize()); + $this->addAction(GetBitbucketCallback::getName(), new GetBitbucketCallback()); + // Installations $this->addAction(GetInstallation::getName(), new GetInstallation()); $this->addAction(ListInstallations::getName(), new ListInstallations()); @@ -61,5 +68,6 @@ class Http extends Service $this->addAction(CreateGitHubEvent::getName(), new CreateGitHubEvent()); $this->addAction(CreateGiteaEvent::getName(), new CreateGiteaEvent()); $this->addAction(CreateGitlabEvent::getName(), new CreateGitlabEvent()); + $this->addAction(CreateBitbucketEvent::getName(), new CreateBitbucketEvent()); } } From 4ddc78e27ac55c1abd4ef473271f9d3b8ac9ddb2 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 20:18:02 +0530 Subject: [PATCH 02/18] fix(oauth2): send Bitbucket access token via Authorization header, not query param Bitbucket's CHANGE-3052 (enforced since 2026-05-04) removed support for ?access_token= query params -- the API now requires the token as a Bearer Authorization header, rejecting the old form with a generic 401 "CHANGE-3052 - Functionality has been deprecated" error. Hit this live during staging testing: OAuth code exchange succeeded, but the getUser() call to fetch the account's own profile failed here. createRepository() already used the header form correctly; only getUser()'s two GET calls needed fixing. --- src/Appwrite/Auth/OAuth2/Bitbucket.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index d20207c7f6..fbf0029e3f 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -228,10 +228,15 @@ class Bitbucket extends OAuth2 protected function getUser(string $accessToken): array { if (empty($this->user)) { - $user = $this->request('GET', 'https://api.bitbucket.org/2.0/user?access_token=' . \urlencode($accessToken)); + // Bitbucket's CHANGE-3052 (enforced since 2026-05-04) removed the + // ?access_token= query param; the token must be sent as a Bearer + // Authorization header instead. + $headers = ['Authorization: Bearer ' . $accessToken]; + + $user = $this->request('GET', 'https://api.bitbucket.org/2.0/user', $headers); $this->user = \json_decode($user, true); - $emails = $this->request('GET', 'https://api.bitbucket.org/2.0/user/emails?access_token=' . \urlencode($accessToken)); + $emails = $this->request('GET', 'https://api.bitbucket.org/2.0/user/emails', $headers); $emails = \json_decode($emails, true); if (isset($emails['values'])) { foreach ($emails['values'] as $email) { From 6d66dbbd5d089fe02284d4f6e95f0c49a3eea375 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 20:27:08 +0530 Subject: [PATCH 03/18] fix(oauth2): authenticate Bitbucket token exchange via Basic Auth Sending client_id/client_secret as body params on /site/oauth2/access_token is silently accepted by the endpoint but fails client authentication -- Bitbucket expects HTTP Basic Auth (base64 client_id:client_secret) here instead, per Atlassian's documented curl example. The failure mode is misleading: a generic "invalid_grant: authorization_code is invalid" rather than an auth error, since the endpoint gets far enough to reject the grant before ever validating the client credentials in the body. Hit this live during staging testing, right after the CHANGE-3052 header fix got past the getUser() call. --- src/Appwrite/Auth/OAuth2/Bitbucket.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index fbf0029e3f..4b26cd5a12 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -53,16 +53,22 @@ class Bitbucket extends OAuth2 protected function getTokens(string $code): array { if (empty($this->tokens)) { - // Required as per Bitbucket Spec. - $headers = ['Content-Type: application/x-www-form-urlencoded']; + // Bitbucket authenticates the client via HTTP Basic Auth on this + // endpoint, not client_id/client_secret in the body -- sending + // them as body params is silently accepted by the endpoint but + // fails client authentication, surfacing as a generic + // "invalid_grant: authorization_code is invalid" rather than an + // auth error. + $headers = [ + 'Content-Type: application/x-www-form-urlencoded', + 'Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret), + ]; $this->tokens = \json_decode($this->request( 'POST', 'https://bitbucket.org/site/oauth2/access_token', $headers, \http_build_query([ 'code' => $code, - 'client_id' => $this->appID, - 'client_secret' => $this->appSecret, 'grant_type' => 'authorization_code' ]) ), true); @@ -78,14 +84,15 @@ class Bitbucket extends OAuth2 */ public function refreshTokens(string $refreshToken): array { - $headers = ['Content-Type: application/x-www-form-urlencoded']; + $headers = [ + 'Content-Type: application/x-www-form-urlencoded', + 'Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret), + ]; $this->tokens = \json_decode($this->request( 'POST', 'https://bitbucket.org/site/oauth2/access_token', $headers, \http_build_query([ - 'client_id' => $this->appID, - 'client_secret' => $this->appSecret, 'grant_type' => 'refresh_token', 'refresh_token' => $refreshToken ]) From f2ee22f4f4dbebfef30533b8d37a0fa5e9d3ed90 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 20:47:52 +0530 Subject: [PATCH 04/18] Widen personalAccessToken/personalRefreshToken to 4096 2048 (the previous widen, for GitLab/Gitea) wasn't enough -- Bitbucket's opaque OAuth tokens (Atlassian's unified identity platform) exceed it. Hit this live during staging testing: OAuth token exchange succeeded, but saving the installation failed on document structure validation. --- app/config/collections/platform.php | 6 ++++-- src/Appwrite/Migration/Version/V25.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 9fd0667d17..a824743456 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -1842,7 +1842,9 @@ $platformCollections = [ '$id' => ID::custom('personalAccessToken'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + // Bitbucket's opaque OAuth tokens (Atlassian's unified identity + // platform) can exceed 2048 chars, unlike GitLab/Gitea's. + 'size' => 4096, 'signed' => true, 'required' => false, 'default' => null, @@ -1864,7 +1866,7 @@ $platformCollections = [ '$id' => ID::custom('personalRefreshToken'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 4096, 'signed' => true, 'required' => false, 'default' => null, diff --git a/src/Appwrite/Migration/Version/V25.php b/src/Appwrite/Migration/Version/V25.php index 0d42606a7f..02109e0475 100644 --- a/src/Appwrite/Migration/Version/V25.php +++ b/src/Appwrite/Migration/Version/V25.php @@ -74,7 +74,7 @@ class V25 extends Migration if ($collectionType === 'console') { foreach (['personalAccessToken', 'personalRefreshToken'] as $attribute) { try { - $this->dbForProject->updateAttribute($id, $attribute, size: 2048); + $this->dbForProject->updateAttribute($id, $attribute, size: 4096); } catch (Throwable $th) { Console::warning("Failed to resize attribute \"{$attribute}\" in collection {$id}: {$th->getMessage()}"); } From 33bccddcb2148d90b38f8c0a401664bd97df6d4d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 20:59:54 +0530 Subject: [PATCH 05/18] fix(oauth2): resolve Bitbucket's personal workspace via /workspaces, not /user getUserSlug() returned /user's nickname for accounts migrated to Atlassian's unified identity -- an opaque display handle, not a workspace identifier. Bitbucket's REST API doesn't recognize it as a workspace and silently returns zero repositories (200 OK, empty results) rather than an error, so this was invisible until actually browsing repos post-connect. Resolves the personal workspace via /workspaces instead, matched by UUID against the user's own account. Existing installations saved with the wrong organization value will need to disconnect/reconnect to pick this up -- there's no stored access token history to retroactively re-derive it from. --- src/Appwrite/Auth/OAuth2/Bitbucket.php | 30 +++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 4b26cd5a12..2174e25dfd 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -160,10 +160,16 @@ class Bitbucket extends OAuth2 } /** - * Bitbucket's `/user` response carries `username` for older accounts and - * `nickname` for accounts migrated to Atlassian identity, which don't - * expose one. Callers (repository creation, ownership resolution) need - * whichever of the two the account actually has. + * The workspace slug repository/ownership API calls actually need to + * address the account's personal workspace. + * + * `/user`'s `username` (old accounts) or `nickname` (accounts migrated to + * Atlassian's unified identity) are display handles, not workspace + * identifiers -- for migrated accounts `nickname` is an opaque value that + * Bitbucket's REST API doesn't recognize as a workspace, silently + * returning zero repositories rather than an error. The personal + * workspace is instead resolved via `/workspaces`, matched by UUID + * against the user's own account. * * @param string $accessToken * @@ -172,8 +178,22 @@ class Bitbucket extends OAuth2 public function getUserSlug(string $accessToken): string { $user = $this->getUser($accessToken); + $userUuid = $user['uuid'] ?? ''; - return $user['username'] ?? ($user['nickname'] ?? ''); + $headers = ['Authorization: Bearer ' . $accessToken]; + $workspaces = \json_decode($this->request('GET', 'https://api.bitbucket.org/2.0/workspaces', $headers), true); + $values = $workspaces['values'] ?? []; + + foreach ($values as $workspace) { + if (!empty($userUuid) && ($workspace['uuid'] ?? '') === $userUuid) { + return $workspace['slug'] ?? ''; + } + } + + // No workspace matched the account UUID directly (unexpected, but + // fall back rather than fail outright): the first workspace, then + // the old username/nickname fields as a last resort. + return $values[0]['slug'] ?? ($user['username'] ?? ($user['nickname'] ?? '')); } /** From 6c4d15725eecdd2a9fa5be7a48be5a5ef8b41885 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 21:07:32 +0530 Subject: [PATCH 06/18] fix(oauth2): use account UUID directly for Bitbucket personal workspace The /workspaces call added to resolve the real workspace (replacing the broken nickname fallback) itself hit CHANGE-2770 -- Atlassian's removal of cross-workspace listing endpoints. Avoids a second API call entirely: a personal account's UUID doubles as its personal workspace identifier, a documented Bitbucket convention, and workspace-scoped endpoints accept the UUID (curly-brace form) anywhere a slug is accepted. --- src/Appwrite/Auth/OAuth2/Bitbucket.php | 32 ++++++++++---------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 2174e25dfd..4831c293a8 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -160,16 +160,22 @@ class Bitbucket extends OAuth2 } /** - * The workspace slug repository/ownership API calls actually need to - * address the account's personal workspace. + * The workspace identifier repository/ownership API calls actually need + * to address the account's personal workspace. * * `/user`'s `username` (old accounts) or `nickname` (accounts migrated to * Atlassian's unified identity) are display handles, not workspace * identifiers -- for migrated accounts `nickname` is an opaque value that * Bitbucket's REST API doesn't recognize as a workspace, silently - * returning zero repositories rather than an error. The personal - * workspace is instead resolved via `/workspaces`, matched by UUID - * against the user's own account. + * returning zero repositories rather than an error. + * + * Listing workspaces to resolve the personal one by matching UUIDs + * (`GET /workspaces`) hit CHANGE-2770 -- Atlassian's removal of + * cross-workspace listing endpoints -- so this instead relies on a + * documented Bitbucket convention instead of a second API call: a + * personal account's own UUID doubles as its personal workspace's + * identifier, and workspace-scoped endpoints accept a UUID (in its + * curly-brace form) anywhere they accept a slug. * * @param string $accessToken * @@ -178,22 +184,8 @@ class Bitbucket extends OAuth2 public function getUserSlug(string $accessToken): string { $user = $this->getUser($accessToken); - $userUuid = $user['uuid'] ?? ''; - $headers = ['Authorization: Bearer ' . $accessToken]; - $workspaces = \json_decode($this->request('GET', 'https://api.bitbucket.org/2.0/workspaces', $headers), true); - $values = $workspaces['values'] ?? []; - - foreach ($values as $workspace) { - if (!empty($userUuid) && ($workspace['uuid'] ?? '') === $userUuid) { - return $workspace['slug'] ?? ''; - } - } - - // No workspace matched the account UUID directly (unexpected, but - // fall back rather than fail outright): the first workspace, then - // the old username/nickname fields as a last resort. - return $values[0]['slug'] ?? ($user['username'] ?? ($user['nickname'] ?? '')); + return $user['uuid'] ?? ($user['username'] ?? ($user['nickname'] ?? '')); } /** From 381b75c287d983470d1d20deae433e7d571333ec Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 21:19:37 +0530 Subject: [PATCH 07/18] fix(oauth2): resolve Bitbucket workspace via /user/workspaces Confirmed live: a personal account's own UUID does NOT double as its personal workspace's UUID -- they're unrelated (verified against a real test account's actual workspace). The previous UUID-shortcut fix silently returned zero repositories for the same underlying reason as the nickname bug it replaced: wrong identifier, no error. GET /workspaces (cross-workspace listing) is what hit CHANGE-2770 in the first place. GET /user/workspaces is the endpoint Atlassian's own migration guidance names as the replacement -- scoped to the authenticated user rather than cross-workspace, so it isn't part of the same deprecation. --- src/Appwrite/Auth/OAuth2/Bitbucket.php | 35 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 4831c293a8..351dc67c42 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -160,22 +160,22 @@ class Bitbucket extends OAuth2 } /** - * The workspace identifier repository/ownership API calls actually need - * to address the account's personal workspace. + * The workspace slug repository/ownership API calls actually need to + * address the account's personal workspace. * * `/user`'s `username` (old accounts) or `nickname` (accounts migrated to * Atlassian's unified identity) are display handles, not workspace * identifiers -- for migrated accounts `nickname` is an opaque value that * Bitbucket's REST API doesn't recognize as a workspace, silently - * returning zero repositories rather than an error. + * returning zero repositories rather than an error. A personal account's + * own UUID does *not* double as its workspace's identifier either -- + * confirmed live, the two UUIDs are unrelated. * - * Listing workspaces to resolve the personal one by matching UUIDs - * (`GET /workspaces`) hit CHANGE-2770 -- Atlassian's removal of - * cross-workspace listing endpoints -- so this instead relies on a - * documented Bitbucket convention instead of a second API call: a - * personal account's own UUID doubles as its personal workspace's - * identifier, and workspace-scoped endpoints accept a UUID (in its - * curly-brace form) anywhere they accept a slug. + * `GET /workspaces` (cross-workspace listing, to resolve the workspace by + * some other means) hit CHANGE-2770 -- Atlassian's removal of that + * endpoint. `GET /user/workspaces` is the endpoint Atlassian's migration + * guidance names as its replacement, scoped to the authenticated user + * rather than cross-workspace, so it isn't part of the same deprecation. * * @param string $accessToken * @@ -185,7 +185,20 @@ class Bitbucket extends OAuth2 { $user = $this->getUser($accessToken); - return $user['uuid'] ?? ($user['username'] ?? ($user['nickname'] ?? '')); + $headers = ['Authorization: Bearer ' . $accessToken]; + $workspaces = \json_decode($this->request('GET', 'https://api.bitbucket.org/2.0/user/workspaces', $headers), true); + $values = $workspaces['values'] ?? []; + // Some Bitbucket user-scoped list endpoints wrap the resource under + // its own key (e.g. the older /permissions/workspaces did); accept + // either shape rather than assume this one is flat. + $first = $values[0] ?? []; + $slug = $first['slug'] ?? ($first['workspace']['slug'] ?? ''); + + if (!empty($slug)) { + return $slug; + } + + return $user['username'] ?? ($user['nickname'] ?? ''); } /** From 7efe4345deef7de4600303be5a3005d3e4768a75 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 21:31:08 +0530 Subject: [PATCH 08/18] Bump utopia-php/vcs: fix getOwnerName() workspace resolution --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 01e279706f..553daf8563 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b" + "reference": "a13125878c07be314afc9f8128a6878b9132f31b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b", - "reference": "dbd51fb21d3d85841d3dd58c9eb94f57a0631c6b", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a13125878c07be314afc9f8128a6878b9132f31b", + "reference": "a13125878c07be314afc9f8128a6878b9132f31b", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-30T12:06:14+00:00" + "time": "2026-07-30T16:00:32+00:00" }, { "name": "utopia-php/websocket", From 55b6aa3fe249b405f4c5ff84a462ded6a6bcf1c7 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 21:50:48 +0530 Subject: [PATCH 09/18] Bump utopia-php/vcs: don't crash worker on missing file in getRepositoryContent --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 553daf8563..e98dfed8af 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "a13125878c07be314afc9f8128a6878b9132f31b" + "reference": "9d62da5242e96195452aa171b8f8afc7370602bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/a13125878c07be314afc9f8128a6878b9132f31b", - "reference": "a13125878c07be314afc9f8128a6878b9132f31b", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/9d62da5242e96195452aa171b8f8afc7370602bc", + "reference": "9d62da5242e96195452aa171b8f8afc7370602bc", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-30T16:00:32+00:00" + "time": "2026-07-30T16:20:27+00:00" }, { "name": "utopia-php/websocket", From a728e1f13e948f21502d4b04a31ff186950f63b7 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 30 Jul 2026 22:10:58 +0530 Subject: [PATCH 10/18] Bump utopia-php/vcs: implement getRepositoryPresignedUrl() for Bitbucket --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index e98dfed8af..7d794858a5 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "9d62da5242e96195452aa171b8f8afc7370602bc" + "reference": "d7f53dae360706367b32e7794f77408fb72e791f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/9d62da5242e96195452aa171b8f8afc7370602bc", - "reference": "9d62da5242e96195452aa171b8f8afc7370602bc", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/d7f53dae360706367b32e7794f77408fb72e791f", + "reference": "d7f53dae360706367b32e7794f77408fb72e791f", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-30T16:20:27+00:00" + "time": "2026-07-30T16:40:37+00:00" }, { "name": "utopia-php/websocket", From 34ca57ef900e5cc065d9dd4e0853a5dc62c6067d Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 31 Jul 2026 13:54:52 +0530 Subject: [PATCH 11/18] Bump utopia-php/vcs: Bitbucket archive format + webhook uuid guard --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 7d794858a5..375d63fd22 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "d7f53dae360706367b32e7794f77408fb72e791f" + "reference": "070f703820ece61c0232614a07dddcd359eb81f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/d7f53dae360706367b32e7794f77408fb72e791f", - "reference": "d7f53dae360706367b32e7794f77408fb72e791f", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/070f703820ece61c0232614a07dddcd359eb81f7", + "reference": "070f703820ece61c0232614a07dddcd359eb81f7", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-30T16:40:37+00:00" + "time": "2026-07-31T08:22:20+00:00" }, { "name": "utopia-php/websocket", From d18bf2636716f4c5caf17d39a532631ea9cf4522 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 31 Jul 2026 16:45:51 +0530 Subject: [PATCH 12/18] fix: store personal access/refresh tokens as TEXT, not a fixed varchar Bumped 512 -> 2048 for GitLab, then 2048 -> 4096 for Bitbucket, and Bitbucket's tokens can already exceed 2800 chars -- each new provider risks needing another bump. Past the varchar ceiling (16381 chars) this stores as TEXT (65535 bytes), which no real provider's token gets remotely close to, so this is the last resize this field should need. Neither attribute is indexed, so the column-type change doesn't hit MySQL's TEXT-indexing restrictions. Also trims two over-long comments in the Bitbucket OAuth2 provider down to the part that matters for a reader. --- app/config/collections/platform.php | 8 +++---- src/Appwrite/Auth/OAuth2/Bitbucket.php | 32 ++++++++------------------ src/Appwrite/Migration/Version/V25.php | 2 +- 3 files changed, 14 insertions(+), 28 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index a824743456..93da2af441 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -1842,9 +1842,9 @@ $platformCollections = [ '$id' => ID::custom('personalAccessToken'), 'type' => Database::VAR_STRING, 'format' => '', - // Bitbucket's opaque OAuth tokens (Atlassian's unified identity - // platform) can exceed 2048 chars, unlike GitLab/Gitea's. - 'size' => 4096, + // Past the varchar ceiling (16381), this stores as TEXT -- + // headroom for any provider's token, not just today's longest. + 'size' => Database::MAX_TEXT_BYTES, 'signed' => true, 'required' => false, 'default' => null, @@ -1866,7 +1866,7 @@ $platformCollections = [ '$id' => ID::custom('personalRefreshToken'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 4096, + 'size' => Database::MAX_TEXT_BYTES, 'signed' => true, 'required' => false, 'default' => null, diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index 351dc67c42..de8b21145c 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -53,12 +53,9 @@ class Bitbucket extends OAuth2 protected function getTokens(string $code): array { if (empty($this->tokens)) { - // Bitbucket authenticates the client via HTTP Basic Auth on this - // endpoint, not client_id/client_secret in the body -- sending - // them as body params is silently accepted by the endpoint but - // fails client authentication, surfacing as a generic - // "invalid_grant: authorization_code is invalid" rather than an - // auth error. + // Bitbucket wants HTTP Basic Auth here, not client_id/secret in + // the body -- the body form fails silently with a misleading + // "invalid_grant" error instead of an auth error. $headers = [ 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Basic ' . \base64_encode($this->appID . ':' . $this->appSecret), @@ -160,25 +157,14 @@ class Bitbucket extends OAuth2 } /** - * The workspace slug repository/ownership API calls actually need to - * address the account's personal workspace. - * - * `/user`'s `username` (old accounts) or `nickname` (accounts migrated to - * Atlassian's unified identity) are display handles, not workspace - * identifiers -- for migrated accounts `nickname` is an opaque value that - * Bitbucket's REST API doesn't recognize as a workspace, silently - * returning zero repositories rather than an error. A personal account's - * own UUID does *not* double as its workspace's identifier either -- - * confirmed live, the two UUIDs are unrelated. - * - * `GET /workspaces` (cross-workspace listing, to resolve the workspace by - * some other means) hit CHANGE-2770 -- Atlassian's removal of that - * endpoint. `GET /user/workspaces` is the endpoint Atlassian's migration - * guidance names as its replacement, scoped to the authenticated user - * rather than cross-workspace, so it isn't part of the same deprecation. + * Resolves the account's personal workspace slug, which repository API + * calls need to address. `/user`'s username/nickname aren't valid + * workspace identifiers for migrated accounts (silently returns zero + * repositories rather than an error), and the account's UUID doesn't + * double as its workspace's either, so this goes through + * GET /user/workspaces instead. * * @param string $accessToken - * * @return string */ public function getUserSlug(string $accessToken): string diff --git a/src/Appwrite/Migration/Version/V25.php b/src/Appwrite/Migration/Version/V25.php index 02109e0475..d234536733 100644 --- a/src/Appwrite/Migration/Version/V25.php +++ b/src/Appwrite/Migration/Version/V25.php @@ -74,7 +74,7 @@ class V25 extends Migration if ($collectionType === 'console') { foreach (['personalAccessToken', 'personalRefreshToken'] as $attribute) { try { - $this->dbForProject->updateAttribute($id, $attribute, size: 4096); + $this->dbForProject->updateAttribute($id, $attribute, size: Database::MAX_TEXT_BYTES); } catch (Throwable $th) { Console::warning("Failed to resize attribute \"{$attribute}\" in collection {$id}: {$th->getMessage()}"); } From b6e3a3ed32a146a96652a589330130b8e71e091a Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 31 Jul 2026 16:48:42 +0530 Subject: [PATCH 13/18] style: drop restating comment on personalAccessToken size --- app/config/collections/platform.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/config/collections/platform.php b/app/config/collections/platform.php index 93da2af441..2dbf3afb6c 100644 --- a/app/config/collections/platform.php +++ b/app/config/collections/platform.php @@ -1842,8 +1842,6 @@ $platformCollections = [ '$id' => ID::custom('personalAccessToken'), 'type' => Database::VAR_STRING, 'format' => '', - // Past the varchar ceiling (16381), this stores as TEXT -- - // headroom for any provider's token, not just today's longest. 'size' => Database::MAX_TEXT_BYTES, 'signed' => true, 'required' => false, From c7395dc48cb4656a648f346cec8774e659dcf9b2 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 6 Aug 2026 13:01:42 +0530 Subject: [PATCH 14/18] Bump utopia-php/vcs: resolve nested branch names on Bitbucket --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 375d63fd22..20e4388d11 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "070f703820ece61c0232614a07dddcd359eb81f7" + "reference": "6543cdc950a0c941d69c1b1b92fa8db670042214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/070f703820ece61c0232614a07dddcd359eb81f7", - "reference": "070f703820ece61c0232614a07dddcd359eb81f7", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/6543cdc950a0c941d69c1b1b92fa8db670042214", + "reference": "6543cdc950a0c941d69c1b1b92fa8db670042214", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-31T08:22:20+00:00" + "time": "2026-08-06T07:21:59+00:00" }, { "name": "utopia-php/websocket", From 9081afb5e7edc2b6d08e8543438186e5f2c0c8e0 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 11:56:25 +0530 Subject: [PATCH 15/18] Bump utopia-php/vcs: Bitbucket check runs --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 20e4388d11..f5f6c2972a 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "6543cdc950a0c941d69c1b1b92fa8db670042214" + "reference": "52ca4fb400312ab8ddaa6fca13db452742f7a42d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/6543cdc950a0c941d69c1b1b92fa8db670042214", - "reference": "6543cdc950a0c941d69c1b1b92fa8db670042214", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/52ca4fb400312ab8ddaa6fca13db452742f7a42d", + "reference": "52ca4fb400312ab8ddaa6fca13db452742f7a42d", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-08-06T07:21:59+00:00" + "time": "2026-08-07T06:18:00+00:00" }, { "name": "utopia-php/websocket", From aaf3db77936264124f6c7f81a25c143feccda6d3 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 12:44:38 +0530 Subject: [PATCH 16/18] Bump utopia-php/vcs: decode the Bitbucket repository id --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index f5f6c2972a..fb2cf95a60 100644 --- a/composer.lock +++ b/composer.lock @@ -5164,12 +5164,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "52ca4fb400312ab8ddaa6fca13db452742f7a42d" + "reference": "5489f06d8c7ce9634698dc8b7d58ce34edba3d1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/52ca4fb400312ab8ddaa6fca13db452742f7a42d", - "reference": "52ca4fb400312ab8ddaa6fca13db452742f7a42d", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/5489f06d8c7ce9634698dc8b7d58ce34edba3d1a", + "reference": "5489f06d8c7ce9634698dc8b7d58ce34edba3d1a", "shasum": "" }, "require": { @@ -5223,7 +5223,7 @@ "source": "https://github.com/utopia-php/vcs/tree/feat-bitbucket-adapter", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-08-07T06:18:00+00:00" + "time": "2026-08-07T07:11:53+00:00" }, { "name": "utopia-php/websocket", From 8e123d60f429352d402f79b9041dae3c186720f0 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 16:02:11 +0530 Subject: [PATCH 17/18] refactor(vcs): handle every event a delivery describes The adapters report the events a delivery describes rather than the first of them, so each provider's endpoint walks what it is handed. A GitHub, GitLab or Gitea delivery still describes one event, and Bitbucket's push describes each branch it touched. --- .../VCS/Http/Bitbucket/Events/Create.php | 4 +--- .../Modules/VCS/Http/GitHub/Events/Create.php | 18 ++++++++++-------- .../Modules/VCS/Http/Gitea/Events/Create.php | 16 +++++++++------- .../Modules/VCS/Http/Gitlab/Events/Create.php | 16 +++++++++------- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Events/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Events/Create.php index 9266e4c8ad..f9621ff179 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Events/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Bitbucket/Events/Create.php @@ -78,9 +78,7 @@ class Create extends Action throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Invalid webhook payload signature. Please make sure the webhook secret has same value in your Bitbucket repository settings and in the _APP_VCS_BITBUCKET_WEBHOOK_SECRET environment variable'); } - // A single push delivery can batch several branches; getEvent() would - // only report the first, silently dropping the rest, so every parsed - // event from the delivery is handled. + // A single Bitbucket push delivery batches every branch it touched $parsedPayloads = $vcs->getEvents($event, $payload); foreach ($parsedPayloads as $parsedPayload) { diff --git a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Events/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Events/Create.php index 6a87450cd9..8db5f1d670 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Events/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/GitHub/Events/Create.php @@ -79,16 +79,18 @@ class Create extends Action throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, "Invalid webhook payload signature. Please make sure the webhook secret has same value in your GitHub app and in the _APP_VCS_GITHUB_WEBHOOK_SECRET environment variable"); } - $parsedPayload = $vcs->getEvent($event, $payload); + $parsedPayloads = $vcs->getEvents($event, $payload); - match ($event) { - GitHub::EVENT_INSTALLATION => $this->handleInstallationEvent($parsedPayload, $dbForPlatform, $authorization, $getProjectDB), - GitHub::EVENT_PUSH => $this->handlePushEvent($parsedPayload, $vcsFactory, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - GitHub::EVENT_PULL_REQUEST => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - default => null, - }; + foreach ($parsedPayloads as $parsedPayload) { + match ($event) { + GitHub::EVENT_INSTALLATION => $this->handleInstallationEvent($parsedPayload, $dbForPlatform, $authorization, $getProjectDB), + GitHub::EVENT_PUSH => $this->handlePushEvent($parsedPayload, $vcsFactory, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + GitHub::EVENT_PULL_REQUEST => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + default => null, + }; + } - $response->json($parsedPayload); + $response->json(['events' => $parsedPayloads]); } protected function preprocessEvent(Request $request) diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php index 113906151d..02bf1baf71 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Gitea/Events/Create.php @@ -77,15 +77,17 @@ class Create extends Action throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Invalid webhook payload signature. Please make sure the webhook secret has same value in your Gitea repository settings and in the _APP_VCS_GITEA_WEBHOOK_SECRET environment variable'); } - $parsedPayload = $vcs->getEvent($event, $payload); + $parsedPayloads = $vcs->getEvents($event, $payload); - match ($event) { - 'push' => $this->handlePushEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - 'pull_request' => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - default => null, - }; + foreach ($parsedPayloads as $parsedPayload) { + match ($event) { + 'push' => $this->handlePushEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + 'pull_request' => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + default => null, + }; + } - $response->json($parsedPayload); + $response->json(['events' => $parsedPayloads]); } private function resolveGiteaInstallation(Document $repository, Database $dbForPlatform, Authorization $authorization): ?Document diff --git a/src/Appwrite/Platform/Modules/VCS/Http/Gitlab/Events/Create.php b/src/Appwrite/Platform/Modules/VCS/Http/Gitlab/Events/Create.php index e770a930a9..f93add52a5 100644 --- a/src/Appwrite/Platform/Modules/VCS/Http/Gitlab/Events/Create.php +++ b/src/Appwrite/Platform/Modules/VCS/Http/Gitlab/Events/Create.php @@ -78,15 +78,17 @@ class Create extends Action throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN, 'Invalid webhook payload signature. Please make sure the webhook secret has same value in your GitLab repository settings and in the _APP_VCS_GITLAB_WEBHOOK_SECRET environment variable'); } - $parsedPayload = $vcs->getEvent($event, $payload); + $parsedPayloads = $vcs->getEvents($event, $payload); - match ($event) { - 'Push Hook' => $this->handlePushEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - 'Merge Request Hook' => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), - default => null, - }; + foreach ($parsedPayloads as $parsedPayload) { + match ($event) { + 'Push Hook' => $this->handlePushEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + 'Merge Request Hook' => $this->handlePullRequestEvent($parsedPayload, $vcsFactory, $installationTokens, $dbForPlatform, $authorization, $getProjectDB, $platform, $deploymentsFactory), + default => null, + }; + } - $response->json($parsedPayload); + $response->json(['events' => $parsedPayloads]); } private function resolveGitlabInstallation(Document $repository, Database $dbForPlatform, Authorization $authorization): ?Document From 956edfb496253c84b0d4c96cd8c8bc85d3bd667e Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 7 Aug 2026 16:05:20 +0530 Subject: [PATCH 18/18] Bump utopia-php/vcs to 5.1.0 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index f42fafee22..4e0ec81935 100644 --- a/composer.lock +++ b/composer.lock @@ -5161,16 +5161,16 @@ }, { "name": "utopia-php/vcs", - "version": "5.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "de39bfdfaa8880b8c4370812cf837e98cf7b0fcf" + "reference": "040a0d5d92ffa33964dc1607d1b95a526c6ffc49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/de39bfdfaa8880b8c4370812cf837e98cf7b0fcf", - "reference": "de39bfdfaa8880b8c4370812cf837e98cf7b0fcf", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/040a0d5d92ffa33964dc1607d1b95a526c6ffc49", + "reference": "040a0d5d92ffa33964dc1607d1b95a526c6ffc49", "shasum": "" }, "require": { @@ -5221,10 +5221,10 @@ "vcs" ], "support": { - "source": "https://github.com/utopia-php/vcs/tree/5.0.0", + "source": "https://github.com/utopia-php/vcs/tree/5.1.0", "issues": "https://github.com/utopia-php/vcs/issues" }, - "time": "2026-07-31T15:03:38+00:00" + "time": "2026-08-07T08:58:14+00:00" }, { "name": "utopia-php/websocket",