From 5a6e8910990640616844d55b2b177b0907ebeb22 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 19 May 2025 01:56:00 +1200 Subject: [PATCH 1/4] Fix invalid matrix read --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a7fc1cf0c6..6fd4e89858 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -303,7 +303,7 @@ jobs: docker compose up -d sleep 30 - - name: Run Projects tests with dev keys in ${{ matrix.tables-mode }} table mode + - name: Run Projects tests with dev keys in dedicated table mode run: | echo "Using project tables" export _APP_DATABASE_SHARED_TABLES= From dd4ffa41af5e1663fcd5330aa37bd1fb5c69c77e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 19 May 2025 01:56:08 +1200 Subject: [PATCH 2/4] Fix header check mismatch --- app/init/resources.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/init/resources.php b/app/init/resources.php index bb1183bd52..180e256870 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -815,7 +815,7 @@ App::setResource('devKey', function (Request $request, Document $project, array // add sdk to key $sdkValidator = new WhiteList($servers, true); - $sdk = $request->getHeader('x-sdk-name', 'UNKNOWN'); + $sdk = \strtolower($request->getHeader('x-sdk-name', 'UNKNOWN')); if ($sdk !== 'UNKNOWN' && $sdkValidator->isValid($sdk)) { $sdks = $key->getAttribute('sdks', []); From 4307bb8b3335d966e1974635e95384ebb23a6547 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 19 May 2025 01:56:25 +1200 Subject: [PATCH 3/4] Fix deprecated method usage --- app/init/resources.php | 2 +- tests/e2e/Services/Proxy/ProxyCustomServerTest.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/init/resources.php b/app/init/resources.php index 180e256870..e96432ad70 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -901,7 +901,7 @@ App::setResource('resourceToken', function ($project, $dbForProject, $request) { $tokenJWT = $request->getParam('token'); if (!empty($tokenJWT) && !$project->isEmpty()) { // JWT authentication - $jwt = new JWT(App::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway. + $jwt = new JWT(System::getEnv('_APP_OPENSSL_KEY_V1'), 'HS256', 900, 10); // Instantiate with key, algo, maxAge and leeway. try { $payload = $jwt->decode($tokenJWT); diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 3f7099e703..988223bd7a 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -8,6 +8,7 @@ use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; use Utopia\App; use Utopia\Database\Query; +use Utopia\System\System; class ProxyCustomServerTest extends Scope { @@ -328,7 +329,7 @@ class ProxyCustomServerTest extends Scope public function testUpdateRule(): void { // Create function appwrite-network domain - $domain = \uniqid() . '-cname-api.' . App::getEnv('_APP_DOMAIN_FUNCTIONS'); + $domain = \uniqid() . '-cname-api.' . System::getEnv('_APP_DOMAIN_FUNCTIONS'); $rule = $this->createAPIRule($domain); $this->assertEquals(201, $rule['headers']['status-code']); @@ -337,7 +338,7 @@ class ProxyCustomServerTest extends Scope $this->cleanupRule($rule['body']['$id']); // Create site appwrite-network domain - $domain = \uniqid() . '-cname-api.' . App::getEnv('_APP_DOMAIN_SITES'); + $domain = \uniqid() . '-cname-api.' . System::getEnv('_APP_DOMAIN_SITES'); $rule = $this->createAPIRule($domain); $this->assertEquals(201, $rule['headers']['status-code']); From bb7055fb47af6e4f287ae7ad98a7d8241261c510 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 19 May 2025 01:59:02 +1200 Subject: [PATCH 4/4] Lint --- tests/e2e/Services/Proxy/ProxyCustomServerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php index 988223bd7a..9a7ba74ec1 100644 --- a/tests/e2e/Services/Proxy/ProxyCustomServerTest.php +++ b/tests/e2e/Services/Proxy/ProxyCustomServerTest.php @@ -6,7 +6,6 @@ use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; -use Utopia\App; use Utopia\Database\Query; use Utopia\System\System;