@@ -68,7 +68,7 @@ public static function assertCommandMatches(stdClass $expected, stdClass $actual
6868 * @param stdClass $test Individual "tests[]" document
6969 * @param array $runOn Top-level "runOn" array with server requirements
7070 * @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
7272 * @param object|null $jsonSchema Top-level "json_schema" array to initialize collection
7373 * @param string $databaseName Name of database under test
7474 * @param string $collectionName Name of collection under test
@@ -170,11 +170,11 @@ public function testDataKeyAndDoubleEncryption(Closure $test)
170170 {
171171 $ client = new Client (static ::getUri ());
172172
173- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
173+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
174174 $ client ->selectCollection ('db ' , 'coll ' )->drop ();
175175
176176 $ encryptionOpts = [
177- 'keyVaultNamespace ' => 'admin .datakeys ' ,
177+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
178178 'kmsProviders ' => [
179179 'aws ' => Context::getAWSCredentials (),
180180 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
@@ -231,7 +231,7 @@ function ($command) use (&$commands) {
231231 $ test ->assertSame ('insert ' , $ insert ->getCommandName ());
232232 $ test ->assertSame (WriteConcern::MAJORITY , $ insert ->getCommand ()->writeConcern ->w );
233233
234- $ keys = $ client ->selectCollection ('admin ' , 'datakeys ' )->find (['_id ' => $ localDatakeyId ]);
234+ $ keys = $ client ->selectCollection ('keyvault ' , 'datakeys ' )->find (['_id ' => $ localDatakeyId ]);
235235 $ keys = iterator_to_array ($ keys );
236236 $ test ->assertCount (1 , $ keys );
237237
@@ -277,7 +277,7 @@ function ($command) use (&$commands) {
277277 $ test ->assertSame ('insert ' , $ insert ->getCommandName ());
278278 $ test ->assertSame (WriteConcern::MAJORITY , $ insert ->getCommand ()->writeConcern ->w );
279279
280- $ keys = $ client ->selectCollection ('admin ' , 'datakeys ' )->find (['_id ' => $ awsDatakeyId ]);
280+ $ keys = $ client ->selectCollection ('keyvault ' , 'datakeys ' )->find (['_id ' => $ awsDatakeyId ]);
281281 $ keys = iterator_to_array ($ keys );
282282 $ test ->assertCount (1 , $ keys );
283283
@@ -314,16 +314,16 @@ public function testExternalKeyVault($withExternalKeyVault)
314314 {
315315 $ client = new Client (static ::getUri ());
316316
317- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
317+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
318318 $ client ->selectCollection ('db ' , 'coll ' )->drop ();
319319
320320 $ keyId = $ client
321- ->selectCollection ('admin ' , 'datakeys ' )
321+ ->selectCollection ('keyvault ' , 'datakeys ' )
322322 ->insertOne ($ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/external/external-key.json ' )))
323323 ->getInsertedId ();
324324
325325 $ encryptionOpts = [
326- 'keyVaultNamespace ' => 'admin .datakeys ' ,
326+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
327327 'kmsProviders ' => [
328328 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
329329 ],
@@ -372,14 +372,14 @@ public function testBSONSizeLimitsAndBatchSplitting()
372372 {
373373 $ client = new Client (static ::getUri ());
374374
375- $ client ->selectCollection ('admin ' , 'datakeys ' )->drop ();
375+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->drop ();
376376 $ client ->selectCollection ('db ' , 'coll ' )->drop ();
377377
378378 $ 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 ' )));
380380
381381 $ autoEncryptionOpts = [
382- 'keyVaultNamespace ' => 'admin .datakeys ' ,
382+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
383383 'kmsProviders ' => [
384384 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
385385 ],
@@ -464,7 +464,7 @@ public function testViewsAreProhibited()
464464 $ client ->selectDatabase ('db ' )->command (['create ' => 'view ' , 'viewOn ' => 'coll ' ]);
465465
466466 $ autoEncryptionOpts = [
467- 'keyVaultNamespace ' => 'admin .datakeys ' ,
467+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
468468 'kmsProviders ' => [
469469 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
470470 ],
@@ -503,14 +503,14 @@ public function testCorpus($schemaMap = true)
503503 ->createCollection ('coll ' , ['validator ' => ['$jsonSchema ' => $ schema ]]);
504504 }
505505
506- $ client ->selectDatabase ('admin ' )->dropCollection ('datakeys ' );
507- $ client ->selectCollection ('admin ' , 'datakeys ' )->insertMany ([
506+ $ client ->selectDatabase ('keyvault ' )->dropCollection ('datakeys ' );
507+ $ client ->selectCollection ('keyvault ' , 'datakeys ' )->insertMany ([
508508 $ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/corpus/corpus-key-local.json ' )),
509509 $ this ->decodeJson (file_get_contents (__DIR__ . '/client-side-encryption/corpus/corpus-key-aws.json ' )),
510510 ]);
511511
512512 $ encryptionOpts = [
513- 'keyVaultNamespace ' => 'admin .datakeys ' ,
513+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
514514 'kmsProviders ' => [
515515 'aws ' => Context::getAWSCredentials (),
516516 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
@@ -561,7 +561,7 @@ public function testCustomEndpoint()
561561 $ client = new Client (static ::getUri ());
562562
563563 $ encryptionOpts = [
564- 'keyVaultNamespace ' => 'admin .datakeys ' ,
564+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
565565 'kmsProviders ' => [
566566 'aws ' => Context::getAWSCredentials (),
567567 ],
@@ -615,7 +615,7 @@ public function testCustomEndpoint()
615615 public function testBypassSpawningMongocryptdViaBypassSpawn ()
616616 {
617617 $ autoEncryptionOpts = [
618- 'keyVaultNamespace ' => 'admin .datakeys ' ,
618+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
619619 'kmsProviders ' => [
620620 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
621621 ],
@@ -648,7 +648,7 @@ public function testBypassSpawningMongocryptdViaBypassSpawn()
648648 public function testBypassSpawningMongocryptdViaBypassAutoEncryption ()
649649 {
650650 $ autoEncryptionOpts = [
651- 'keyVaultNamespace ' => 'admin .datakeys ' ,
651+ 'keyVaultNamespace ' => 'keyvault .datakeys ' ,
652652 'kmsProviders ' => [
653653 'local ' => ['key ' => new Binary (base64_decode (self ::LOCAL_MASTERKEY ), 0 )],
654654 ],
@@ -743,7 +743,7 @@ private function insertKeyVaultData(array $keyVaultData = null)
743743 }
744744
745745 $ 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 );
747747 $ collection ->drop ();
748748 $ collection ->insertMany ($ keyVaultData );
749749
0 commit comments