mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Require explicit endpoint + apiKey for external Appwrite sources
This commit is contained in:
@@ -214,6 +214,13 @@ class Migrations extends Action
|
||||
throw new Exception(Exception::MIGRATION_SOURCE_PROJECT_NOT_FOUND);
|
||||
}
|
||||
$projectDB = call_user_func($this->getProjectDB, $this->sourceProject);
|
||||
} elseif ($this->sourceProject->isEmpty()) {
|
||||
// External source — processMigration defaults missing endpoint/apiKey to this
|
||||
// instance, which would silently self-call with the destination's key. Require
|
||||
// explicit credentials so the failure mode is clear.
|
||||
if (empty($credentials['endpoint']) || empty($credentials['apiKey'])) {
|
||||
throw new Exception(Exception::MIGRATION_SOURCE_PROJECT_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
$getDatabasesDB = fn (Document $database): Database =>
|
||||
|
||||
Reference in New Issue
Block a user