Skip to content

Commit fbf390c

Browse files
committed
Merge remote-tracking branch 'origin/1.8.x' into feat-health-module
2 parents 4905f7c + 0fee1f0 commit fbf390c

230 files changed

Lines changed: 6679 additions & 4409 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/cli.php

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
// require controllers after overwriting runtimes
4242
require_once __DIR__ . '/controllers/general.php';
4343

44-
Authorization::disable();
45-
4644
CLI::setResource('register', fn () => $register);
4745

4846
CLI::setResource('cache', function ($pools) {
@@ -60,7 +58,13 @@
6058
return $register->get('pools');
6159
}, ['register']);
6260

63-
CLI::setResource('dbForPlatform', function ($pools, $cache) {
61+
CLI::setResource('authorization', function () {
62+
$authorization = new Authorization();
63+
$authorization->disable();
64+
return $authorization;
65+
}, []);
66+
67+
CLI::setResource('dbForPlatform', function ($pools, $cache, $authorization) {
6468
$sleep = 3;
6569
$maxAttempts = 5;
6670
$attempts = 0;
@@ -74,6 +78,8 @@
7478
$dbForPlatform = new Database($adapter, $cache);
7579

7680
$dbForPlatform
81+
->setDatabase(APP_DATABASE)
82+
->setAuthorization($authorization)
7783
->setNamespace('_console')
7884
->setMetadata('host', \gethostname())
7985
->setMetadata('project', 'console');
@@ -99,7 +105,7 @@
99105
}
100106

101107
return $dbForPlatform;
102-
}, ['pools', 'cache']);
108+
}, ['pools', 'cache', 'authorization']);
103109

104110
CLI::setResource('console', function () {
105111
return new Document(Config::getParam('console'));
@@ -110,10 +116,10 @@
110116
fn () => fn (Document $project, string $resourceType, ?string $resourceId) => false
111117
);
112118

113-
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
119+
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache, $authorization) {
114120
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
115121

116-
return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) {
122+
return function (Document $project) use ($pools, $dbForPlatform, $cache, $authorization, &$databases) {
117123
if ($project->isEmpty() || $project->getId() === 'console') {
118124
return $dbForPlatform;
119125
}
@@ -146,6 +152,7 @@
146152

147153
$adapter = new DatabasePool($pools->get($dsn->getHost()));
148154
$database = new Database($adapter, $cache);
155+
149156
$databases[$dsn->getHost()] = $database;
150157
$sharedTables = \explode(',', System::getEnv('_APP_DATABASE_SHARED_TABLES', ''));
151158

@@ -162,17 +169,19 @@
162169
}
163170

164171
$database
172+
->setDatabase(APP_DATABASE)
173+
->setAuthorization($authorization)
165174
->setMetadata('host', \gethostname())
166175
->setMetadata('project', $project->getId());
167176

168177
return $database;
169178
};
170-
}, ['pools', 'dbForPlatform', 'cache']);
179+
}, ['pools', 'dbForPlatform', 'cache', 'authorization']);
171180

172-
CLI::setResource('getLogsDB', function (Group $pools, Cache $cache) {
181+
CLI::setResource('getLogsDB', function (Group $pools, Cache $cache, Authorization $authorization) {
173182
$database = null;
174183

175-
return function (?Document $project = null) use ($pools, $cache, $database) {
184+
return function (?Document $project = null) use ($pools, $cache, $database, $authorization) {
176185
if ($database !== null && $project !== null && !$project->isEmpty() && $project->getId() !== 'console') {
177186
$database->setTenant((int)$project->getSequence());
178187
return $database;
@@ -182,6 +191,8 @@
182191
$database = new Database($adapter, $cache);
183192

184193
$database
194+
->setDatabase(APP_DATABASE)
195+
->setAuthorization($authorization)
185196
->setSharedTables(true)
186197
->setNamespace('logsV1')
187198
->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS_TASK)
@@ -194,7 +205,7 @@
194205

195206
return $database;
196207
};
197-
}, ['pools', 'cache']);
208+
}, ['pools', 'cache', 'authorization']);
198209
CLI::setResource('publisher', function (Group $pools) {
199210
return new BrokerPool(publisher: $pools->get('publisher'));
200211
}, ['pools']);

app/config/sdks.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
[
6161
'key' => 'flutter',
6262
'name' => 'Flutter',
63-
'version' => '20.3.2',
63+
'version' => '20.3.3',
6464
'url' => 'https://github.com/appwrite/sdk-for-flutter',
6565
'package' => 'https://pub.dev/packages/appwrite',
6666
'enabled' => true,
@@ -227,7 +227,7 @@
227227
[
228228
'key' => 'cli',
229229
'name' => 'Command Line',
230-
'version' => '12.0.1',
230+
'version' => '13.0.0',
231231
'url' => 'https://github.com/appwrite/sdk-for-cli',
232232
'package' => 'https://www.npmjs.com/package/appwrite-cli',
233233
'enabled' => true,
@@ -377,7 +377,7 @@
377377
[
378378
'key' => 'dart',
379379
'name' => 'Dart',
380-
'version' => '20.1.0',
380+
'version' => '20.1.1',
381381
'url' => 'https://github.com/appwrite/sdk-for-dart',
382382
'package' => 'https://pub.dev/packages/dart_appwrite',
383383
'enabled' => true,

0 commit comments

Comments
 (0)