Add expire field to migration console key response

This commit is contained in:
Prem Palanisamy
2026-03-03 15:31:44 +00:00
parent 01ccee520b
commit 01c2d0f04b
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -17,6 +17,7 @@ use Utopia\Compression\Algorithms\Zstd;
use Utopia\Compression\Compression;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\DateTime;
use Utopia\Database\Document;
use Utopia\Database\Exception\Order as OrderException;
use Utopia\Database\Exception\Query as QueryException;
@@ -741,7 +742,8 @@ Http::get('/v1/migrations/appwrite/console-key')
]);
$response->dynamic(new Document([
'key' => API_KEY_DYNAMIC . '_' . $consoleKey,
'key' => API_KEY_DYNAMIC . '_' . $consoleKey,
'expire' => DateTime::addSeconds(new \DateTime(), APP_CONSOLE_KEY_TTL),
]), Response::MODEL_MIGRATION_KEY);
});
@@ -15,6 +15,12 @@ class MigrationKey extends Model
'description' => 'Temporary API key for settings migration.',
'default' => '',
'example' => 'dynamic_eyJ...',
])
->addRule('expire', [
'type' => self::TYPE_DATETIME,
'description' => 'Key expiration date in ISO 8601 format.',
'default' => '',
'example' => self::TYPE_DATETIME_EXAMPLE,
]);
}