diff --git a/app/config/cors.php b/app/config/cors.php new file mode 100644 index 0000000000..ef1adeb998 --- /dev/null +++ b/app/config/cors.php @@ -0,0 +1,53 @@ + ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], + 'allowedHeaders' => [ + 'Accept', + 'Origin', + 'Cookie', + 'Set-Cookie', + // Content + 'Content-Type', + 'Content-Range', + // Appwrite + 'X-Appwrite-Project', + 'X-Appwrite-Key', + 'X-Appwrite-Dev-Key', + 'X-Appwrite-Locale', + 'X-Appwrite-Mode', + 'X-Appwrite-JWT', + 'X-Appwrite-Response-Format', + 'X-Appwrite-Timeout', + 'X-Appwrite-ID', + 'X-Appwrite-Timestamp', + 'X-Appwrite-Session', + 'X-Appwrite-Platform', + // SDK generator + 'X-SDK-Version', + 'X-SDK-Name', + 'X-SDK-Language', + 'X-SDK-Platform', + 'X-SDK-GraphQL', + 'X-SDK-Profile', + // Caching + 'Range', + 'Cache-Control', + 'Expires', + 'Pragma', + // Server to server + 'X-Fallback-Cookies', + 'X-Requested-With', + 'X-Forwarded-For', + 'X-Forwarded-User-Agent', + ], + 'exposedHeaders' => [ + 'X-Appwrite-Session', + 'X-Fallback-Cookies', + ], +]; diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index 31d1929b63..5a864ab928 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -11,6 +11,9 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CompoundUID; use Appwrite\Utopia\Database\Validator\Queries\Migrations; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Order as OrderException; @@ -29,9 +32,6 @@ use Utopia\Migration\Sources\Firebase; use Utopia\Migration\Sources\NHost; use Utopia\Migration\Sources\Supabase; use Utopia\Migration\Transfer; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\ArrayList; diff --git a/app/init/configs.php b/app/init/configs.php index d5748707cf..35c8e3899d 100644 --- a/app/init/configs.php +++ b/app/init/configs.php @@ -46,3 +46,4 @@ Config::load('storage-outputs', __DIR__ . '/../config/storage/outputs.php', $con Config::load('specifications', __DIR__ . '/../config/specifications.php', $configAdapter); Config::load('templates-function', __DIR__ . '/../config/templates/function.php', $configAdapter); Config::load('templates-site', __DIR__ . '/../config/templates/site.php', $configAdapter); +Config::load('cors', __DIR__ . '/../config/cors.php', $configAdapter); diff --git a/app/init/resources.php b/app/init/resources.php index 914cffffee..1fd6079fda 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -300,54 +300,17 @@ Http::setResource('rule', function (Request $request, Database $dbForPlatform, D /** * CORS service */ -Http::setResource('cors', fn (array $allowedHostnames) => new Cors( - $allowedHostnames, - allowedMethods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], - allowedHeaders: [ - 'Accept', - 'Origin', - 'Cookie', - 'Set-Cookie', - // Content - 'Content-Type', - 'Content-Range', - // Appwrite - 'X-Appwrite-Project', - 'X-Appwrite-Key', - 'X-Appwrite-Dev-Key', - 'X-Appwrite-Locale', - 'X-Appwrite-Mode', - 'X-Appwrite-JWT', - 'X-Appwrite-Response-Format', - 'X-Appwrite-Timeout', - 'X-Appwrite-ID', - 'X-Appwrite-Timestamp', - 'X-Appwrite-Session', - 'X-Appwrite-Platform', // for `$platform` injection and SDK generator - // SDK generator - 'X-SDK-Version', - 'X-SDK-Name', - 'X-SDK-Language', - 'X-SDK-Platform', - 'X-SDK-GraphQL', - 'X-SDK-Profile', - // Caching - 'Range', - 'Cache-Control', - 'Expires', - 'Pragma', - // Server to server - 'X-Fallback-Cookies', - 'X-Requested-With', - 'X-Forwarded-For', - 'X-Forwarded-User-Agent', - ], - allowCredentials: true, - exposedHeaders: [ - 'X-Appwrite-Session', - 'X-Fallback-Cookies', - ], -), ['allowedHostnames']); +Http::setResource('cors', function (array $allowedHostnames) { + $corsConfig = Config::getParam('cors'); + + return new Cors( + $allowedHostnames, + allowedMethods: $corsConfig['allowedMethods'], + allowedHeaders: $corsConfig['allowedHeaders'], + allowCredentials: true, + exposedHeaders: $corsConfig['exposedHeaders'], + ); +}, ['allowedHostnames']); Http::setResource('originValidator', function (Document $devKey, array $allowedHostnames, array $allowedSchemes) { if (!$devKey->isEmpty()) { diff --git a/composer.json b/composer.json index 76a968bdec..793b9d61a1 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "utopia-php/auth": "0.5.*", "utopia-php/cache": "1.0.*", "utopia-php/cli": "0.22.*", + "utopia-php/compression": "0.1.*", "utopia-php/config": "1.*", "utopia-php/console": "0.1.*", "utopia-php/database": "5.*", @@ -74,7 +75,7 @@ "utopia-php/preloader": "0.2.*", "utopia-php/queue": "0.15.*", "utopia-php/registry": "0.5.*", - "utopia-php/storage": "0.18.*", + "utopia-php/storage": "1.0.*", "utopia-php/system": "0.10.*", "utopia-php/telemetry": "0.2.*", "utopia-php/vcs": "1.*", diff --git a/composer.lock b/composer.lock index c6728a45db..184899e6bf 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": "54a7d2d3c93926e306fbc8012d0c646e", + "content-hash": "dd9887a50fb434887461a99413007573", "packages": [ { "name": "adhocore/jwt", @@ -4464,16 +4464,16 @@ }, { "name": "utopia-php/migration", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "aa07cf9ae8cc4b8df0ab64588e033693b5ad6849" + "reference": "c5c7544d02d2418536d41050794050132f247d62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/aa07cf9ae8cc4b8df0ab64588e033693b5ad6849", - "reference": "aa07cf9ae8cc4b8df0ab64588e033693b5ad6849", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/c5c7544d02d2418536d41050794050132f247d62", + "reference": "c5c7544d02d2418536d41050794050132f247d62", "shasum": "" }, "require": { @@ -4484,7 +4484,7 @@ "php": ">=8.1", "utopia-php/database": "5.*", "utopia-php/dsn": "0.2.*", - "utopia-php/storage": "0.18.*" + "utopia-php/storage": "1.0.*" }, "require-dev": { "ext-pdo": "*", @@ -4513,9 +4513,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/1.6.0" + "source": "https://github.com/utopia-php/migration/tree/1.6.1" }, - "time": "2026-02-16T07:19:27+00:00" + "time": "2026-02-17T05:49:48+00:00" }, { "name": "utopia-php/mongo", @@ -4953,32 +4953,27 @@ }, { "name": "utopia-php/storage", - "version": "0.18.19", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/storage.git", - "reference": "9c3f9a471250d22de7d405ee19e23e72b14181ca" + "reference": "f672e8865938e5d1d6dc3bd149ceba4e5582199e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/storage/zipball/9c3f9a471250d22de7d405ee19e23e72b14181ca", - "reference": "9c3f9a471250d22de7d405ee19e23e72b14181ca", + "url": "https://api.github.com/repos/utopia-php/storage/zipball/f672e8865938e5d1d6dc3bd149ceba4e5582199e", + "reference": "f672e8865938e5d1d6dc3bd149ceba4e5582199e", "shasum": "" }, "require": { - "ext-brotli": "*", "ext-curl": "*", "ext-fileinfo": "*", - "ext-lz4": "*", "ext-simplexml": "*", - "ext-snappy": "*", - "ext-xz": "*", "ext-zlib": "*", - "ext-zstd": "*", "php": ">=8.1", - "utopia-php/framework": "0.*.*", "utopia-php/system": "0.*.*", - "utopia-php/telemetry": "0.2.*" + "utopia-php/telemetry": "0.2.*", + "utopia-php/validators": "0.2.*" }, "require-dev": { "laravel/pint": "1.2.*", @@ -5005,9 +5000,9 @@ ], "support": { "issues": "https://github.com/utopia-php/storage/issues", - "source": "https://github.com/utopia-php/storage/tree/0.18.19" + "source": "https://github.com/utopia-php/storage/tree/1.0.0" }, - "time": "2025-12-17T13:55:20+00:00" + "time": "2026-02-17T04:37:10+00:00" }, { "name": "utopia-php/system", diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php index f5f7a7974b..485078af88 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php @@ -7,6 +7,7 @@ use Appwrite\Event\Realtime; use Appwrite\Permission; use Appwrite\Role; use Exception; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Console; use Utopia\Database\Database; @@ -16,7 +17,6 @@ use Utopia\Database\Query; use Utopia\Fetch\Client as FetchClient; use Utopia\Platform\Action; use Utopia\Queue\Message; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Create.php index c78402e5a4..f31d30188a 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Create.php @@ -9,6 +9,7 @@ use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Response; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; @@ -17,7 +18,6 @@ use Utopia\Database\Helpers\ID; use Utopia\Database\Helpers\Permission; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Storage; use Utopia\System\System; use Utopia\Validator\ArrayList; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php index 6473f1058a..827dbc8dd9 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php @@ -14,6 +14,9 @@ use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Database\Validator\CustomId; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Exception\Duplicate as DuplicateException; @@ -28,9 +31,6 @@ use Utopia\Database\Validator\UID; use Utopia\Http\Adapter\Swoole\Request; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\Storage\Storage; use Utopia\Storage\Validator\File; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php index 4a52c87238..042ae76565 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Download/Get.php @@ -11,6 +11,9 @@ use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; @@ -19,9 +22,6 @@ use Utopia\Database\Validator\UID; use Utopia\Http\Adapter\Swoole\Request; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\Text; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php index a53cbb3a52..63a72fc683 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Preview/Get.php @@ -11,6 +11,9 @@ use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Console; use Utopia\Database\Database; @@ -23,9 +26,6 @@ use Utopia\Http\Adapter\Swoole\Request; use Utopia\Image\Image; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\HexColor; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php index 60846cb546..c475c53d24 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Push/Get.php @@ -8,6 +8,9 @@ use Appwrite\Extend\Exception; use Appwrite\OpenSSL\OpenSSL; use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; @@ -16,9 +19,6 @@ use Utopia\Database\Validator\UID; use Utopia\Http\Adapter\Swoole\Request; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\Text; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php index 73e7e58421..cba6c2fa13 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/View/Get.php @@ -11,6 +11,9 @@ use Appwrite\SDK\MethodType; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Database\Documents\User; use Appwrite\Utopia\Response; +use Utopia\Compression\Algorithms\GZIP; +use Utopia\Compression\Algorithms\Zstd; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Database\Database; use Utopia\Database\Document; @@ -20,9 +23,6 @@ use Utopia\Database\Validator\UID; use Utopia\Http\Adapter\Swoole\Request; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Algorithms\GZIP; -use Utopia\Storage\Compression\Algorithms\Zstd; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; use Utopia\Validator\Text; diff --git a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Update.php b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Update.php index 9dd5a29967..e4827a6354 100644 --- a/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Update.php +++ b/src/Appwrite/Platform/Modules/Storage/Http/Buckets/Update.php @@ -8,13 +8,13 @@ use Appwrite\SDK\AuthType; use Appwrite\SDK\Method; use Appwrite\SDK\Response as SDKResponse; use Appwrite\Utopia\Response; +use Utopia\Compression\Compression; use Utopia\Database\Database; use Utopia\Database\Helpers\Permission; use Utopia\Database\Validator\Permissions; use Utopia\Database\Validator\UID; use Utopia\Platform\Action; use Utopia\Platform\Scope\HTTP; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Storage; use Utopia\System\System; use Utopia\Validator\ArrayList; diff --git a/src/Appwrite/Platform/Workers/Migrations.php b/src/Appwrite/Platform/Workers/Migrations.php index 94cbcf341c..5e729af98f 100644 --- a/src/Appwrite/Platform/Workers/Migrations.php +++ b/src/Appwrite/Platform/Workers/Migrations.php @@ -8,6 +8,7 @@ use Appwrite\Event\Realtime; use Appwrite\Event\StatsUsage; use Appwrite\Extend\Exception; use Appwrite\Template\Template; +use Utopia\Compression\Compression; use Utopia\Config\Config; use Utopia\Console; use Utopia\Database\Database; @@ -39,7 +40,6 @@ use Utopia\Migration\Sources\Supabase; use Utopia\Migration\Transfer; use Utopia\Platform\Action; use Utopia\Queue\Message; -use Utopia\Storage\Compression\Compression; use Utopia\Storage\Device; use Utopia\System\System; diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php b/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php index 436a95534b..c49788872e 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Migrations.php @@ -10,6 +10,8 @@ class Migrations extends Base 'source', 'destination', 'resources', + 'resourceId', + 'resourceType', 'statusCounters', 'resourceData', 'errors' diff --git a/src/Appwrite/Utopia/Response/Model/Bucket.php b/src/Appwrite/Utopia/Response/Model/Bucket.php index aece4cf850..d66a27be97 100644 --- a/src/Appwrite/Utopia/Response/Model/Bucket.php +++ b/src/Appwrite/Utopia/Response/Model/Bucket.php @@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; -use Utopia\Storage\Compression\Compression; +use Utopia\Compression\Compression; class Bucket extends Model { diff --git a/src/Appwrite/Utopia/Response/Model/File.php b/src/Appwrite/Utopia/Response/Model/File.php index c4e36286ea..9b3e6ff618 100644 --- a/src/Appwrite/Utopia/Response/Model/File.php +++ b/src/Appwrite/Utopia/Response/Model/File.php @@ -4,8 +4,8 @@ namespace Appwrite\Utopia\Response\Model; use Appwrite\Utopia\Response; use Appwrite\Utopia\Response\Model; +use Utopia\Compression\Compression; use Utopia\Database\Document; -use Utopia\Storage\Compression\Compression; class File extends Model { diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index c516aab73f..cd33a29685 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -283,6 +283,12 @@ class Project extends Model 'example' => ['vip'], 'array' => true, ]) + ->addRule('status', [ + 'type' => self::TYPE_STRING, + 'description' => 'Project status.', + 'default' => 'active', + 'example' => 'active', + ]) ; $services = Config::getParam('services', []); diff --git a/tests/e2e/General/HTTPTest.php b/tests/e2e/General/HTTPTest.php index 4012745682..261bab9348 100644 --- a/tests/e2e/General/HTTPTest.php +++ b/tests/e2e/General/HTTPTest.php @@ -6,6 +6,7 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectNone; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideNone; +use Utopia\Config\Config; class HTTPTest extends Scope { @@ -28,11 +29,16 @@ class HTTPTest extends Scope 'content-type' => 'application/json', ]), []); + $corsConfig = Config::getParam('cors'); + $allowedMethods = \implode(', ', $corsConfig['allowedMethods']); + $allowedHeaders = \implode(', ', $corsConfig['allowedHeaders']); + $exposedHeaders = \implode(', ', $corsConfig['exposedHeaders']); + $this->assertEquals(204, $response['headers']['status-code']); $this->assertEquals('Appwrite', $response['headers']['server']); - $this->assertEquals('GET, POST, PUT, PATCH, DELETE', $response['headers']['access-control-allow-methods']); - $this->assertEquals('Accept, Origin, Cookie, Set-Cookie, Content-Type, Content-Range, X-Appwrite-Project, X-Appwrite-Key, X-Appwrite-Dev-Key, X-Appwrite-Locale, X-Appwrite-Mode, X-Appwrite-JWT, X-Appwrite-Response-Format, X-Appwrite-Timeout, X-Appwrite-ID, X-Appwrite-Timestamp, X-Appwrite-Session, X-Appwrite-Platform, X-SDK-Version, X-SDK-Name, X-SDK-Language, X-SDK-Platform, X-SDK-GraphQL, X-SDK-Profile, Range, Cache-Control, Expires, Pragma, X-Fallback-Cookies, X-Requested-With, X-Forwarded-For, X-Forwarded-User-Agent', $response['headers']['access-control-allow-headers']); - $this->assertEquals('X-Appwrite-Session, X-Fallback-Cookies', $response['headers']['access-control-expose-headers']); + $this->assertEquals($allowedMethods, $response['headers']['access-control-allow-methods']); + $this->assertEquals($allowedHeaders, $response['headers']['access-control-allow-headers']); + $this->assertEquals($exposedHeaders, $response['headers']['access-control-expose-headers']); $this->assertEquals('http://localhost', $response['headers']['access-control-allow-origin']); $this->assertEquals('true', $response['headers']['access-control-allow-credentials']); $this->assertEmpty($response['body']); diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index c6e7206c85..6ac9475046 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -57,6 +57,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertNotEmpty($response['body']['$id']); $this->assertEquals('Project Test', $response['body']['name']); $this->assertEquals($team['body']['$id'], $response['body']['teamId']); + $this->assertEquals(PROJECT_STATUS_ACTIVE, $response['body']['status']); $this->assertArrayHasKey('platforms', $response['body']); $this->assertArrayHasKey('webhooks', $response['body']); $this->assertArrayHasKey('keys', $response['body']); @@ -76,6 +77,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertNotEmpty($response['body']['$id']); $this->assertEquals('Project Test', $response['body']['name']); $this->assertEquals($team['body']['$id'], $response['body']['teamId']); + $this->assertEquals(PROJECT_STATUS_ACTIVE, $response['body']['status']); $this->assertArrayHasKey('platforms', $response['body']); $this->assertArrayHasKey('webhooks', $response['body']); $this->assertArrayHasKey('keys', $response['body']);