@@ -68,7 +68,7 @@ public static function assertCommandMatches(stdClass $expected, stdClass $actual
68
68
* @param stdClass $test Individual "tests[]" document
69
69
* @param array $runOn Top-level "runOn" array with server requirements
70
70
* @param array $data Top-level "data" array to initialize collection
71
- * @param array|null $keyVaultData Top-level "key_vault_data" array to initialize admin .datakeys collection
71
+ * @param array|null $keyVaultData Top-level "key_vault_data" array to initialize keyvault .datakeys collection
72
72
* @param object|null $jsonSchema Top-level "json_schema" array to initialize collection
73
73
* @param string $databaseName Name of database under test
74
74
* @param string $collectionName Name of collection under test
@@ -170,11 +170,11 @@ public function testDataKeyAndDoubleEncryption(Closure $test)
170
170
{
171
171
$ client = new Client (static ::getUri ());
172
172
173
- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
173
+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
174
174
$ client ->selectCollection ('db ' , 'coll ' )->drop ();
175
175
176
176
$ encryptionOpts = [
177
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
177
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
178
178
'kmsProviders ' => [
179
179
'aws ' => Context::getAWSCredentials (),
180
180
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
@@ -231,7 +231,7 @@ function ($command) use (&$commands) {
231
231
$ test ->assertSame ('insert ' , $ insert ->getCommandName ());
232
232
$ test ->assertSame (WriteConcern::MAJORITY , $ insert ->getCommand ()->writeConcern ->w );
233
233
234
- $ keys = $ client ->selectCollection ('admin ' , 'datakeys ' )->find (['_id ' => $ localDatakeyId ]);
234
+ $ keys = $ client ->selectCollection ('keyvault ' , 'datakeys ' )->find (['_id ' => $ localDatakeyId ]);
235
235
$ keys = iterator_to_array ($ keys );
236
236
$ test ->assertCount (1 , $ keys );
237
237
@@ -277,7 +277,7 @@ function ($command) use (&$commands) {
277
277
$ test ->assertSame ('insert ' , $ insert ->getCommandName ());
278
278
$ test ->assertSame (WriteConcern::MAJORITY , $ insert ->getCommand ()->writeConcern ->w );
279
279
280
- $ keys = $ client ->selectCollection ('admin ' , 'datakeys ' )->find (['_id ' => $ awsDatakeyId ]);
280
+ $ keys = $ client ->selectCollection ('keyvault ' , 'datakeys ' )->find (['_id ' => $ awsDatakeyId ]);
281
281
$ keys = iterator_to_array ($ keys );
282
282
$ test ->assertCount (1 , $ keys );
283
283
@@ -314,16 +314,16 @@ public function testExternalKeyVault($withExternalKeyVault)
314
314
{
315
315
$ client = new Client (static ::getUri ());
316
316
317
- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
317
+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
318
318
$ client ->selectCollection ('db ' , 'coll ' )->drop ();
319
319
320
320
$ keyId = $ client
321
- ->selectCollection ('admin ' , 'datakeys ' )
321
+ ->selectCollection ('keyvault ' , 'datakeys ' )
322
322
->insertOne ($ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/external/external-key.json ' )))
323
323
->getInsertedId ();
324
324
325
325
$ encryptionOpts = [
326
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
326
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
327
327
'kmsProviders ' => [
328
328
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
329
329
],
@@ -372,14 +372,14 @@ public function testBSONSizeLimitsAndBatchSplitting()
372
372
{
373
373
$ client = new Client (static ::getUri ());
374
374
375
- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
375
+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
376
376
$ client ->selectCollection ('db ' , 'coll ' )->drop ();
377
377
378
378
$ client ->selectDatabase ('db ' )->createCollection ('coll ' , ['validator ' => ['$jsonSchema ' => $ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/limits/limits-schema.json ' ))]]);
379
- $ client ->selectCollection ('admin ' , 'datakeys ' )->insertOne ($ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/limits/limits-key.json ' )));
379
+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->insertOne ($ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/limits/limits-key.json ' )));
380
380
381
381
$ autoEncryptionOpts = [
382
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
382
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
383
383
'kmsProviders ' => [
384
384
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
385
385
],
@@ -464,7 +464,7 @@ public function testViewsAreProhibited()
464
464
$ client ->selectDatabase ('db ' )->command (['create ' => 'view ' , 'viewOn ' => 'coll ' ]);
465
465
466
466
$ autoEncryptionOpts = [
467
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
467
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
468
468
'kmsProviders ' => [
469
469
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
470
470
],
@@ -503,14 +503,14 @@ public function testCorpus($schemaMap = true)
503
503
->createCollection ('coll ' , ['validator ' => ['$jsonSchema ' => $ schema ]]);
504
504
}
505
505
506
- $ client ->selectDatabase ('admin ' )->dropCollection ('datakeys ' );
507
- $ client ->selectCollection ('admin ' , 'datakeys ' )->insertMany ([
506
+ $ client ->selectDatabase ('keyvault ' )->dropCollection ('datakeys ' );
507
+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->insertMany ([
508
508
$ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/corpus/corpus-key-local.json ' )),
509
509
$ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/corpus/corpus-key-aws.json ' )),
510
510
]);
511
511
512
512
$ encryptionOpts = [
513
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
513
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
514
514
'kmsProviders ' => [
515
515
'aws ' => Context::getAWSCredentials (),
516
516
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
@@ -561,7 +561,7 @@ public function testCustomEndpoint()
561
561
$ client = new Client (static ::getUri ());
562
562
563
563
$ encryptionOpts = [
564
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
564
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
565
565
'kmsProviders ' => [
566
566
'aws ' => Context::getAWSCredentials (),
567
567
],
@@ -615,7 +615,7 @@ public function testCustomEndpoint()
615
615
public function testBypassSpawningMongocryptdViaBypassSpawn ()
616
616
{
617
617
$ autoEncryptionOpts = [
618
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
618
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
619
619
'kmsProviders ' => [
620
620
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
621
621
],
@@ -648,7 +648,7 @@ public function testBypassSpawningMongocryptdViaBypassSpawn()
648
648
public function testBypassSpawningMongocryptdViaBypassAutoEncryption ()
649
649
{
650
650
$ autoEncryptionOpts = [
651
- 'keyVaultNamespace ' => 'admin .datakeys ' ,
651
+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
652
652
'kmsProviders ' => [
653
653
'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
654
654
],
@@ -743,7 +743,7 @@ private function insertKeyVaultData(array $keyVaultData = null)
743
743
}
744
744
745
745
$ context = $ this ->getContext ();
746
- $ collection = $ context ->selectCollection ('admin ' , 'datakeys ' , ['writeConcern ' => new WriteConcern (WriteConcern::MAJORITY )] + $ context ->defaultWriteOptions );
746
+ $ collection = $ context ->selectCollection ('keyvault ' , 'datakeys ' , ['writeConcern ' => new WriteConcern (WriteConcern::MAJORITY )] + $ context ->defaultWriteOptions );
747
747
$ collection ->drop ();
748
748
$ collection ->insertMany ($ keyVaultData );
749
749
0 commit comments