From e8b8a8fe5204c527cfe8cce4f66e348282d9e90f Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 25 Dec 2025 18:52:57 +0200 Subject: [PATCH 1/7] add webhook exist validation in balkTrigger() --- .../Http/Databases/Collections/Documents/Action.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php index 08eea88e19..45a06f506e 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php @@ -382,9 +382,11 @@ abstract class Action extends DatabasesAction ->from($queueForEvents) ->trigger(); - $queueForWebhooks - ->from($queueForEvents) - ->trigger(); + if (!empty($queueForEvents->getProject()->getAttribute('webhooks', []))) { + $queueForWebhooks + ->from($queueForEvents) + ->trigger(); + } } $queueForEvents->reset(); From f9efdfd98e8dc7b8144cc759260f0f25f6d5f1fb Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 25 Dec 2025 19:07:51 +0200 Subject: [PATCH 2/7] fix: use nullsafe operator for project attribute retrieval in Action class --- .../Databases/Http/Databases/Collections/Documents/Action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php index 45a06f506e..f16d00998d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Action.php @@ -382,7 +382,7 @@ abstract class Action extends DatabasesAction ->from($queueForEvents) ->trigger(); - if (!empty($queueForEvents->getProject()->getAttribute('webhooks', []))) { + if (!empty($queueForEvents->getProject()?->getAttribute('webhooks', []))) { $queueForWebhooks ->from($queueForEvents) ->trigger(); From 7e37046959bbbc1a457d504942fef8c73d80b21e Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sat, 27 Dec 2025 20:19:27 +0530 Subject: [PATCH 3/7] chore: remove warning logs when skipping ssl certificate generation --- app/controllers/general.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 996b1dce98..23de89af27 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -1048,18 +1048,15 @@ App::init() if (empty($domain->get()) || !$domain->isKnown() || $domain->isTest()) { $cache[$domain->get()] = false; Config::setParam('hostnames', $cache); - Console::warning($domain->get() . ' is not a publicly accessible domain. Skipping SSL certificate generation.'); return; } if (str_starts_with($request->getURI(), '/.well-known/acme-challenge')) { - Console::warning('Skipping SSL certificates generation on ACME challenge.'); return; } // 3. Check if domain is a main domain if (!in_array($domain->get(), $platformHostnames)) { - Console::warning($domain->get() . ' is not a main domain. Skipping SSL certificate generation.'); return; } From 0599d23cc5a71efb57155b9f4c9d98a67695c418 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sat, 27 Dec 2025 20:38:44 +0530 Subject: [PATCH 4/7] fix: specs generation getPlatforms method --- src/Appwrite/Platform/Tasks/SDKs.php | 7 ++++++- src/Appwrite/Platform/Tasks/Specs.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index 798f40ebe7..e2ea93fdff 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -36,6 +36,11 @@ class SDKs extends Action return 'sdks'; } + public static function getPlatforms(): array + { + return Specs::getPlatforms(); + } + public function __construct() { $this @@ -55,7 +60,7 @@ class SDKs extends Action public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message, ?string $release, ?string $commit, ?string $sdks): void { if (!$sdks) { - $selectedPlatform ??= Console::confirm('Choose Platform ("' . implode('", "', Specs::getPlatforms()) . '" or "*" for all):'); + $selectedPlatform ??= Console::confirm('Choose Platform ("' . implode('", "', static::getPlatforms()) . '" or "*" for all):'); $selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):')); } else { $sdks = explode(',', $sdks); diff --git a/src/Appwrite/Platform/Tasks/Specs.php b/src/Appwrite/Platform/Tasks/Specs.php index 96f29e08ad..19526060a8 100644 --- a/src/Appwrite/Platform/Tasks/Specs.php +++ b/src/Appwrite/Platform/Tasks/Specs.php @@ -239,7 +239,7 @@ class Specs extends Action App::setResource('dbForPlatform', fn () => new Database(new MySQL(''), new Cache(new None()))); App::setResource('dbForProject', fn () => new Database(new MySQL(''), new Cache(new None()))); - $platforms = self::getPlatforms(); + $platforms = static::getPlatforms(); $authCounts = $this->getAuthCounts(); $keys = $this->getKeys(); From 0c425dbac3e06c9f8e67132d96ee8d4e83a289c1 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 28 Dec 2025 01:48:23 +0000 Subject: [PATCH 5/7] Fix: assign user permission to files/documents only if not a previleged user --- app/controllers/api/storage.php | 4 ++-- .../Databases/Http/Databases/Collections/Documents/Create.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index e6f4394e25..ec4cc25ea3 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -461,7 +461,7 @@ App::post('/v1/storage/buckets/:bucketId/files') // Add permissions for current the user if none were provided. if (\is_null($permissions)) { $permissions = []; - if (!empty($user->getId())) { + if (!empty($user->getId()) && !$isPrivilegedUser) { foreach ($allowedPermissions as $permission) { $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); } @@ -470,7 +470,7 @@ App::post('/v1/storage/buckets/:bucketId/files') // Users can only manage their own roles, API keys and Admin users can manage any $roles = Authorization::getRoles(); - if (!User::isApp($roles) && !User::isPrivileged($roles)) { + if (!$isAPIKey && !$isPrivilegedUser) { foreach (Database::PERMISSIONS as $type) { foreach ($permissions as $permission) { $permission = Permission::parse($permission); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php index 7c3a06ab30..6ec06f5c8a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Create.php @@ -227,7 +227,7 @@ class Create extends Action // Add permissions for current the user if none were provided. if (\is_null($permissions)) { $permissions = []; - if (!empty($user->getId())) { + if (!empty($user->getId()) && !$isPrivilegedUser) { foreach ($allowedPermissions as $permission) { $permissions[] = (new Permission($permission, 'user', $user->getId()))->toString(); } From 3a983617365cd33cff4b6d130a0aa58fc1c56c5d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 28 Dec 2025 02:02:34 +0000 Subject: [PATCH 6/7] add test --- .../Storage/StorageConsoleClientTest.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/e2e/Services/Storage/StorageConsoleClientTest.php b/tests/e2e/Services/Storage/StorageConsoleClientTest.php index 5c618d6357..2c39a12f09 100644 --- a/tests/e2e/Services/Storage/StorageConsoleClientTest.php +++ b/tests/e2e/Services/Storage/StorageConsoleClientTest.php @@ -160,4 +160,40 @@ class StorageConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(204, $response['headers']['status-code']); } + + public function testFilePermissionNotAutoSetInConsole(): void + { + // Create a bucket + $bucket = $this->client->call(Client::METHOD_POST, '/storage/buckets', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'bucketId' => ID::unique(), + 'name' => 'Test Bucket Permissions', + 'fileSecurity' => true, + ]); + $this->assertEquals(201, $bucket['headers']['status-code']); + $bucketId = $bucket['body']['$id']; + + // Create a file without providing permissions (console client should not auto-set permissions) + $file = $this->client->call(Client::METHOD_POST, '/storage/buckets/' . $bucketId . '/files', array_merge([ + 'content-type' => 'multipart/form-data', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'fileId' => ID::unique(), + 'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'test.png'), + ]); + $this->assertEquals(201, $file['headers']['status-code']); + + // Verify file permissions are empty (not auto-set for privileged console user) + $this->assertIsArray($file['body']['$permissions']); + $this->assertEmpty($file['body']['$permissions']); + + // Clean up: delete the bucket + $response = $this->client->call(Client::METHOD_DELETE, '/storage/buckets/' . $bucketId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); + $this->assertEquals(204, $response['headers']['status-code']); + } } From 77930a0cec42bf3c57dba1219a411263e3ce4279 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 28 Dec 2025 20:46:23 +0530 Subject: [PATCH 7/7] fix: default namespace in sdks --- app/config/sdks.php | 2 ++ src/Appwrite/Platform/Tasks/SDKs.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/config/sdks.php b/app/config/sdks.php index 78209cc5dd..9b5d17176f 100644 --- a/app/config/sdks.php +++ b/app/config/sdks.php @@ -116,6 +116,7 @@ return [ [ 'key' => 'android', 'name' => 'Android', + 'namespace' => 'io.appwrite', 'version' => '11.4.0', 'url' => 'https://github.com/appwrite/sdk-for-android', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-android', @@ -395,6 +396,7 @@ return [ [ 'key' => 'kotlin', 'name' => 'Kotlin', + 'namespace' => 'io.appwrite', 'version' => '13.1.0', 'url' => 'https://github.com/appwrite/sdk-for-kotlin', 'package' => 'https://search.maven.org/artifact/io.appwrite/sdk-for-kotlin', diff --git a/src/Appwrite/Platform/Tasks/SDKs.php b/src/Appwrite/Platform/Tasks/SDKs.php index e2ea93fdff..5d8cb98ae7 100644 --- a/src/Appwrite/Platform/Tasks/SDKs.php +++ b/src/Appwrite/Platform/Tasks/SDKs.php @@ -379,7 +379,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND $sdk ->setName($language['name']) - ->setNamespace('io appwrite') + ->setNamespace($language['namespace'] ?? 'appwrite') ->setDescription("Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the {$language['name']} SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)") ->setShortDescription('Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API') ->setLicense($license)