From 33a24ad77addb2aecc30aaa35c6183fe18a389ee Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Jan 2026 14:39:58 +1300 Subject: [PATCH 1/3] Update deps --- composer.json | 4 +-- composer.lock | 77 +++++++++++++++++++++++++-------------------------- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/composer.json b/composer.json index 5f9235d..ffc7093 100755 --- a/composer.json +++ b/composer.json @@ -22,8 +22,8 @@ "ext-pdo": "*", "ext-curl": "*", "ext-redis": "*", - "utopia-php/database": "3.*.*", - "appwrite/appwrite": "19.*.*" + "utopia-php/database": "4.*", + "appwrite/appwrite": "19.*" }, "require-dev": { "phpunit/phpunit": "9.*", diff --git a/composer.lock b/composer.lock index 5599565..0f687d2 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": "77897ae78f63709875ab922685547528", + "content-hash": "fca63c0aef58e61245c71a861b7169ae", "packages": [ { "name": "appwrite/appwrite", @@ -187,16 +187,16 @@ }, { "name": "google/protobuf", - "version": "v4.33.2", + "version": "v4.33.4", "source": { "type": "git", "url": "https://github.com/protocolbuffers/protobuf-php.git", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318" + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", - "reference": "fbd96b7bf1343f4b0d8fb358526c7ba4d72f1318", + "url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/22d28025cda0d223a2e48c2e16c5284ecc9f5402", + "reference": "22d28025cda0d223a2e48c2e16c5284ecc9f5402", "shasum": "" }, "require": { @@ -225,9 +225,9 @@ "proto" ], "support": { - "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.2" + "source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.33.4" }, - "time": "2025-12-05T22:12:22+00:00" + "time": "2026-01-12T17:58:43+00:00" }, { "name": "mongodb/mongodb", @@ -2166,16 +2166,16 @@ }, { "name": "utopia-php/database", - "version": "3.6.1", + "version": "4.5.1", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7" + "reference": "7b935bb09aeae8aeff5a28f6f2485cef1cc4d898" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/c8c1b2f5770245dd4006e2680681e3efbe8b1fa7", - "reference": "c8c1b2f5770245dd4006e2680681e3efbe8b1fa7", + "url": "https://api.github.com/repos/utopia-php/database/zipball/7b935bb09aeae8aeff5a28f6f2485cef1cc4d898", + "reference": "7b935bb09aeae8aeff5a28f6f2485cef1cc4d898", "shasum": "" }, "require": { @@ -2218,29 +2218,29 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/3.6.1" + "source": "https://github.com/utopia-php/database/tree/4.5.1" }, - "time": "2025-12-16T09:55:41+00:00" + "time": "2026-01-14T12:07:24+00:00" }, { "name": "utopia-php/framework", - "version": "0.33.35", + "version": "0.33.37", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "82b139fb04f30045db51b0d322224f222da32313" + "reference": "30a119d76531d89da9240496940c84fcd9e1758b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/82b139fb04f30045db51b0d322224f222da32313", - "reference": "82b139fb04f30045db51b0d322224f222da32313", + "url": "https://api.github.com/repos/utopia-php/http/zipball/30a119d76531d89da9240496940c84fcd9e1758b", + "reference": "30a119d76531d89da9240496940c84fcd9e1758b", "shasum": "" }, "require": { "php": ">=8.3", "utopia-php/compression": "0.1.*", "utopia-php/telemetry": "0.1.*", - "utopia-php/validators": "0.1.*" + "utopia-php/validators": "0.2.*" }, "require-dev": { "laravel/pint": "1.*", @@ -2266,9 +2266,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.33.35" + "source": "https://github.com/utopia-php/http/tree/0.33.37" }, - "time": "2025-12-12T08:33:52+00:00" + "time": "2026-01-13T10:10:21+00:00" }, { "name": "utopia-php/mongo", @@ -2435,16 +2435,16 @@ }, { "name": "utopia-php/validators", - "version": "0.1.0", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/utopia-php/validators.git", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080" + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/validators/zipball/5c57d5b6cf964f8981807c1d3ea8df620c869080", - "reference": "5c57d5b6cf964f8981807c1d3ea8df620c869080", + "url": "https://api.github.com/repos/utopia-php/validators/zipball/30b6030a5b100fc1dff34506e5053759594b2a20", + "reference": "30b6030a5b100fc1dff34506e5053759594b2a20", "shasum": "" }, "require": { @@ -2452,7 +2452,7 @@ }, "require-dev": { "laravel/pint": "1.*", - "phpstan/phpstan": "1.*", + "phpstan/phpstan": "2.*", "phpunit/phpunit": "11.*" }, "type": "library", @@ -2474,9 +2474,9 @@ ], "support": { "issues": "https://github.com/utopia-php/validators/issues", - "source": "https://github.com/utopia-php/validators/tree/0.1.0" + "source": "https://github.com/utopia-php/validators/tree/0.2.0" }, - "time": "2025-11-18T11:05:46+00:00" + "time": "2026-01-13T09:16:51+00:00" } ], "packages-dev": [ @@ -2559,30 +2559,29 @@ }, { "name": "doctrine/instantiator", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/23da848e1a2308728fe5fdddabf4be17ff9720c7", + "reference": "23da848e1a2308728fe5fdddabf4be17ff9720c7", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^8.4" }, "require-dev": { - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^14", "ext-pdo": "*", "ext-phar": "*", "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5.58" }, "type": "library", "autoload": { @@ -2609,7 +2608,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + "source": "https://github.com/doctrine/instantiator/tree/2.1.0" }, "funding": [ { @@ -2625,7 +2624,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2026-01-05T06:47:08+00:00" }, { "name": "doctrine/lexer", From 98c6d7bcf8c8241a9e6b508e1ea6667360d2ec58 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Jan 2026 14:42:42 +1300 Subject: [PATCH 2/3] Update authz --- src/Abuse/Adapters/TimeLimit/Database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Abuse/Adapters/TimeLimit/Database.php b/src/Abuse/Adapters/TimeLimit/Database.php index 9fa8a4c..9978f62 100644 --- a/src/Abuse/Adapters/TimeLimit/Database.php +++ b/src/Abuse/Adapters/TimeLimit/Database.php @@ -139,7 +139,7 @@ protected function count(string $key, int $timestamp): int $timestamp = $this->toDateTime($timestamp); /** @var array $result */ - $result = Authorization::skip(function () use ($key, $timestamp) { + $result = $this->db->getAuthorization()->skip(function () use ($key, $timestamp) { return $this->db->find(self::COLLECTION, [ Query::equal('key', [$key]), Query::equal('time', [$timestamp]), @@ -172,7 +172,7 @@ protected function hit(string $key, int $timestamp): void } $timestamp = $this->toDateTime($timestamp); - Authorization::skip(function () use ($timestamp, $key) { + $this->db->getAuthorization()->skip(function () use ($timestamp, $key) { $data = $this->db->findOne(self::COLLECTION, [ Query::equal('key', [$key]), Query::equal('time', [$timestamp]), @@ -226,7 +226,7 @@ protected function hit(string $key, int $timestamp): void protected function set(string $key, int $timestamp, int $value): void { $timestamp = $this->toDateTime($timestamp); - Authorization::skip(function () use ($timestamp, $key, $value) { + $this->db->getAuthorization()->skip(function () use ($timestamp, $key, $value) { $data = $this->db->findOne(self::COLLECTION, [ Query::equal('key', [$key]), Query::equal('time', [$timestamp]), @@ -284,7 +284,7 @@ protected function set(string $key, int $timestamp, int $value): void public function getLogs(?int $offset = null, ?int $limit = 25): array { /** @var array $results */ - $results = Authorization::skip(function () use ($offset, $limit) { + $results = $this->db->getAuthorization()->skip(function () use ($offset, $limit) { $queries = []; $queries[] = Query::orderDesc(''); @@ -312,7 +312,7 @@ public function getLogs(?int $offset = null, ?int $limit = 25): array public function cleanup(int $timestamp): bool { $timestamp = $this->toDateTime($timestamp); - Authorization::skip(function () use ($timestamp) { + $this->db->getAuthorization()->skip(function () use ($timestamp) { do { $documents = $this->db->find(self::COLLECTION, [ Query::lessThan('time', $timestamp), From b7fc9512e640e8d78cfef284338d1e7b317e78c9 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 15 Jan 2026 14:44:42 +1300 Subject: [PATCH 3/3] Lint --- src/Abuse/Adapters/TimeLimit/Database.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Abuse/Adapters/TimeLimit/Database.php b/src/Abuse/Adapters/TimeLimit/Database.php index 9978f62..01202fd 100644 --- a/src/Abuse/Adapters/TimeLimit/Database.php +++ b/src/Abuse/Adapters/TimeLimit/Database.php @@ -10,7 +10,6 @@ use Utopia\Database\Exception\Duplicate; use Utopia\Database\Exception\Structure; use Utopia\Database\Query; -use Utopia\Database\Validator\Authorization; use Utopia\Exception; class Database extends TimeLimit