mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Use unique API key name in migration test + bump migration pin
This commit is contained in:
Generated
+4
-4
@@ -4679,12 +4679,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/migration.git",
|
||||
"reference": "16ff6ce143a7aff20bc8c86007264bce4c767ca2"
|
||||
"reference": "91140887b9ff8efcefe326857115bd37c90db1cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/migration/zipball/16ff6ce143a7aff20bc8c86007264bce4c767ca2",
|
||||
"reference": "16ff6ce143a7aff20bc8c86007264bce4c767ca2",
|
||||
"url": "https://api.github.com/repos/utopia-php/migration/zipball/91140887b9ff8efcefe326857115bd37c90db1cf",
|
||||
"reference": "91140887b9ff8efcefe326857115bd37c90db1cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4744,7 +4744,7 @@
|
||||
"source": "https://github.com/utopia-php/migration/tree/add-policies-migration",
|
||||
"issues": "https://github.com/utopia-php/migration/issues"
|
||||
},
|
||||
"time": "2026-05-20T12:08:45+00:00"
|
||||
"time": "2026-05-21T12:22:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/mongo",
|
||||
|
||||
@@ -2554,10 +2554,14 @@ trait MigrationsBase
|
||||
'x-appwrite-key' => $this->getDestinationProject()['apiKey'],
|
||||
];
|
||||
|
||||
// Unique name so re-runs and parallel suites can't match a stale key
|
||||
// left behind by a previous crashed run.
|
||||
$keyName = 'Test API Key ' . ID::unique();
|
||||
|
||||
// Create API key on source project
|
||||
$response = $this->client->call(Client::METHOD_POST, '/project/keys', $sourceHeaders, [
|
||||
'keyId' => ID::unique(),
|
||||
'name' => 'Test API Key',
|
||||
'name' => $keyName,
|
||||
'scopes' => ['databases.read', 'databases.write'],
|
||||
'expire' => null,
|
||||
]);
|
||||
@@ -2596,7 +2600,7 @@ trait MigrationsBase
|
||||
$foundKey = null;
|
||||
|
||||
foreach ($response['body']['keys'] as $k) {
|
||||
if ($k['name'] === 'Test API Key') {
|
||||
if ($k['name'] === $keyName) {
|
||||
$foundKey = $k;
|
||||
|
||||
break;
|
||||
@@ -2604,7 +2608,7 @@ trait MigrationsBase
|
||||
}
|
||||
|
||||
$this->assertNotNull($foundKey);
|
||||
$this->assertEquals('Test API Key', $foundKey['name']);
|
||||
$this->assertEquals($keyName, $foundKey['name']);
|
||||
$this->assertEqualsCanonicalizing(['databases.read', 'databases.write'], $foundKey['scopes']);
|
||||
$this->assertEmpty($foundKey['expire']);
|
||||
$this->assertNotEquals($apiKey['secret'], $foundKey['secret']);
|
||||
|
||||
Reference in New Issue
Block a user