From e2f2ce3da8c8a875d8389d4dfb02342b091b577a Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Tue, 3 Mar 2026 20:33:11 +0000 Subject: [PATCH] Change console-key endpoint from GET to POST --- app/controllers/api/migrations.php | 6 +++--- tests/e2e/Services/Migrations/MigrationsBase.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/migrations.php b/app/controllers/api/migrations.php index dd5dc26ff4..fb5dc1f62d 100644 --- a/app/controllers/api/migrations.php +++ b/app/controllers/api/migrations.php @@ -694,14 +694,14 @@ Http::get('/v1/migrations/:migrationId') $response->dynamic($migration, Response::MODEL_MIGRATION); }); -Http::get('/v1/migrations/appwrite/console-key') +Http::post('/v1/migrations/appwrite/console-key') ->groups(['api', 'migrations']) - ->desc('Generate console API key for migration') + ->desc('Create console API key for migration') ->label('scope', 'migrations.write') ->label('sdk', new Method( namespace: 'migrations', group: null, - name: 'getAppwriteConsoleKey', + name: 'createAppwriteConsoleKey', description: '/docs/references/migrations/migration-appwrite-console-key.md', auth: [AuthType::KEY], responses: [ diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 963d517c3f..20d4774b7d 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -1175,7 +1175,7 @@ trait MigrationsBase */ public function testGetAppwriteConsoleKey(): void { - $response = $this->client->call(Client::METHOD_GET, '/migrations/appwrite/console-key', [ + $response = $this->client->call(Client::METHOD_POST, '/migrations/appwrite/console-key', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-key' => $this->getProject()['apiKey'], @@ -1229,7 +1229,7 @@ trait MigrationsBase $this->assertEquals(0, $result['statusCounters'][Resource::TYPE_PLATFORM]['warning']); // Get a console key for the destination project to access console-scoped endpoints - $consoleKeyResponse = $this->client->call(Client::METHOD_GET, '/migrations/appwrite/console-key', [ + $consoleKeyResponse = $this->client->call(Client::METHOD_POST, '/migrations/appwrite/console-key', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getDestinationProject()['$id'], 'x-appwrite-key' => $this->getDestinationProject()['apiKey'],