mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add expire field to migration console key response
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user