1{
2 "runOn": [
3 {
4 "minServerVersion": "7.0.0",
5 "topology": [
6 "replicaset",
7 "sharded",
8 "load-balanced"
9 ]
10 }
11 ],
12 "database_name": "default",
13 "collection_name": "default",
14 "tests": [
15 {
16 "description": "state collections and index are created",
17 "clientOptions": {
18 "autoEncryptOpts": {
19 "kmsProviders": {
20 "aws": {}
21 },
22 "encryptedFieldsMap": {
23 "default.encryptedCollection": {
24 "fields": [
25 {
26 "path": "firstName",
27 "bsonType": "string",
28 "keyId": {
29 "$binary": {
30 "subType": "04",
31 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
32 }
33 }
34 }
35 ]
36 }
37 }
38 }
39 },
40 "operations": [
41 {
42 "name": "dropCollection",
43 "object": "database",
44 "arguments": {
45 "collection": "encryptedCollection"
46 }
47 },
48 {
49 "name": "createCollection",
50 "object": "database",
51 "arguments": {
52 "collection": "encryptedCollection"
53 }
54 },
55 {
56 "name": "assertCollectionExists",
57 "object": "testRunner",
58 "arguments": {
59 "database": "default",
60 "collection": "enxcol_.encryptedCollection.esc"
61 }
62 },
63 {
64 "name": "assertCollectionNotExists",
65 "object": "testRunner",
66 "arguments": {
67 "database": "default",
68 "collection": "enxcol_.encryptedCollection.ecc"
69 }
70 },
71 {
72 "name": "assertCollectionExists",
73 "object": "testRunner",
74 "arguments": {
75 "database": "default",
76 "collection": "enxcol_.encryptedCollection.ecoc"
77 }
78 },
79 {
80 "name": "assertCollectionExists",
81 "object": "testRunner",
82 "arguments": {
83 "database": "default",
84 "collection": "encryptedCollection"
85 }
86 },
87 {
88 "name": "assertIndexExists",
89 "object": "testRunner",
90 "arguments": {
91 "database": "default",
92 "collection": "encryptedCollection",
93 "index": "__safeContent___1"
94 }
95 }
96 ],
97 "expectations": [
98 {
99 "command_started_event": {
100 "command": {
101 "drop": "enxcol_.encryptedCollection.esc"
102 },
103 "command_name": "drop",
104 "database_name": "default"
105 }
106 },
107 {
108 "command_started_event": {
109 "command": {
110 "drop": "enxcol_.encryptedCollection.ecoc"
111 },
112 "command_name": "drop",
113 "database_name": "default"
114 }
115 },
116 {
117 "command_started_event": {
118 "command": {
119 "drop": "encryptedCollection"
120 },
121 "command_name": "drop",
122 "database_name": "default"
123 }
124 },
125 {
126 "command_started_event": {
127 "command": {
128 "create": "enxcol_.encryptedCollection.esc",
129 "clusteredIndex": {
130 "key": {
131 "_id": 1
132 },
133 "unique": true
134 }
135 },
136 "command_name": "create",
137 "database_name": "default"
138 }
139 },
140 {
141 "command_started_event": {
142 "command": {
143 "create": "enxcol_.encryptedCollection.ecoc",
144 "clusteredIndex": {
145 "key": {
146 "_id": 1
147 },
148 "unique": true
149 }
150 },
151 "command_name": "create",
152 "database_name": "default"
153 }
154 },
155 {
156 "command_started_event": {
157 "command": {
158 "create": "encryptedCollection",
159 "encryptedFields": {
160 "escCollection": null,
161 "ecocCollection": null,
162 "eccCollection": null,
163 "fields": [
164 {
165 "path": "firstName",
166 "bsonType": "string",
167 "keyId": {
168 "$binary": {
169 "subType": "04",
170 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
171 }
172 }
173 }
174 ]
175 }
176 },
177 "command_name": "create",
178 "database_name": "default"
179 }
180 },
181 {
182 "command_started_event": {
183 "command": {
184 "createIndexes": "encryptedCollection",
185 "indexes": [
186 {
187 "name": "__safeContent___1",
188 "key": {
189 "__safeContent__": 1
190 }
191 }
192 ]
193 },
194 "command_name": "createIndexes",
195 "database_name": "default"
196 }
197 }
198 ]
199 },
200 {
201 "description": "default state collection names are applied",
202 "clientOptions": {
203 "autoEncryptOpts": {
204 "kmsProviders": {
205 "aws": {}
206 },
207 "encryptedFieldsMap": {
208 "default.encryptedCollection": {
209 "fields": [
210 {
211 "path": "firstName",
212 "bsonType": "string",
213 "keyId": {
214 "$binary": {
215 "subType": "04",
216 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
217 }
218 }
219 }
220 ]
221 }
222 }
223 }
224 },
225 "operations": [
226 {
227 "name": "dropCollection",
228 "object": "database",
229 "arguments": {
230 "collection": "encryptedCollection"
231 }
232 },
233 {
234 "name": "createCollection",
235 "object": "database",
236 "arguments": {
237 "collection": "encryptedCollection"
238 }
239 },
240 {
241 "name": "assertCollectionExists",
242 "object": "testRunner",
243 "arguments": {
244 "database": "default",
245 "collection": "enxcol_.encryptedCollection.esc"
246 }
247 },
248 {
249 "name": "assertCollectionNotExists",
250 "object": "testRunner",
251 "arguments": {
252 "database": "default",
253 "collection": "enxcol_.encryptedCollection.ecc"
254 }
255 },
256 {
257 "name": "assertCollectionExists",
258 "object": "testRunner",
259 "arguments": {
260 "database": "default",
261 "collection": "enxcol_.encryptedCollection.ecoc"
262 }
263 },
264 {
265 "name": "assertCollectionExists",
266 "object": "testRunner",
267 "arguments": {
268 "database": "default",
269 "collection": "encryptedCollection"
270 }
271 },
272 {
273 "name": "assertIndexExists",
274 "object": "testRunner",
275 "arguments": {
276 "database": "default",
277 "collection": "encryptedCollection",
278 "index": "__safeContent___1"
279 }
280 }
281 ],
282 "expectations": [
283 {
284 "command_started_event": {
285 "command": {
286 "drop": "enxcol_.encryptedCollection.esc"
287 },
288 "command_name": "drop",
289 "database_name": "default"
290 }
291 },
292 {
293 "command_started_event": {
294 "command": {
295 "drop": "enxcol_.encryptedCollection.ecoc"
296 },
297 "command_name": "drop",
298 "database_name": "default"
299 }
300 },
301 {
302 "command_started_event": {
303 "command": {
304 "drop": "encryptedCollection"
305 },
306 "command_name": "drop",
307 "database_name": "default"
308 }
309 },
310 {
311 "command_started_event": {
312 "command": {
313 "create": "enxcol_.encryptedCollection.esc",
314 "clusteredIndex": {
315 "key": {
316 "_id": 1
317 },
318 "unique": true
319 }
320 },
321 "command_name": "create",
322 "database_name": "default"
323 }
324 },
325 {
326 "command_started_event": {
327 "command": {
328 "create": "enxcol_.encryptedCollection.ecoc",
329 "clusteredIndex": {
330 "key": {
331 "_id": 1
332 },
333 "unique": true
334 }
335 },
336 "command_name": "create",
337 "database_name": "default"
338 }
339 },
340 {
341 "command_started_event": {
342 "command": {
343 "create": "encryptedCollection",
344 "encryptedFields": {
345 "escCollection": null,
346 "ecocCollection": null,
347 "eccCollection": null,
348 "fields": [
349 {
350 "path": "firstName",
351 "bsonType": "string",
352 "keyId": {
353 "$binary": {
354 "subType": "04",
355 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
356 }
357 }
358 }
359 ]
360 }
361 },
362 "command_name": "create",
363 "database_name": "default"
364 }
365 },
366 {
367 "command_started_event": {
368 "command": {
369 "createIndexes": "encryptedCollection",
370 "indexes": [
371 {
372 "name": "__safeContent___1",
373 "key": {
374 "__safeContent__": 1
375 }
376 }
377 ]
378 },
379 "command_name": "createIndexes",
380 "database_name": "default"
381 }
382 }
383 ]
384 },
385 {
386 "description": "drop removes all state collections",
387 "clientOptions": {
388 "autoEncryptOpts": {
389 "kmsProviders": {
390 "aws": {}
391 },
392 "encryptedFieldsMap": {
393 "default.encryptedCollection": {
394 "fields": [
395 {
396 "path": "firstName",
397 "bsonType": "string",
398 "keyId": {
399 "$binary": {
400 "subType": "04",
401 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
402 }
403 }
404 }
405 ]
406 }
407 }
408 }
409 },
410 "operations": [
411 {
412 "name": "dropCollection",
413 "object": "database",
414 "arguments": {
415 "collection": "encryptedCollection"
416 }
417 },
418 {
419 "name": "createCollection",
420 "object": "database",
421 "arguments": {
422 "collection": "encryptedCollection"
423 }
424 },
425 {
426 "name": "assertCollectionExists",
427 "object": "testRunner",
428 "arguments": {
429 "database": "default",
430 "collection": "enxcol_.encryptedCollection.esc"
431 }
432 },
433 {
434 "name": "assertCollectionNotExists",
435 "object": "testRunner",
436 "arguments": {
437 "database": "default",
438 "collection": "enxcol_.encryptedCollection.ecc"
439 }
440 },
441 {
442 "name": "assertCollectionExists",
443 "object": "testRunner",
444 "arguments": {
445 "database": "default",
446 "collection": "enxcol_.encryptedCollection.ecoc"
447 }
448 },
449 {
450 "name": "assertCollectionExists",
451 "object": "testRunner",
452 "arguments": {
453 "database": "default",
454 "collection": "encryptedCollection"
455 }
456 },
457 {
458 "name": "assertIndexExists",
459 "object": "testRunner",
460 "arguments": {
461 "database": "default",
462 "collection": "encryptedCollection",
463 "index": "__safeContent___1"
464 }
465 },
466 {
467 "name": "dropCollection",
468 "object": "database",
469 "arguments": {
470 "collection": "encryptedCollection"
471 }
472 },
473 {
474 "name": "assertCollectionNotExists",
475 "object": "testRunner",
476 "arguments": {
477 "database": "default",
478 "collection": "enxcol_.encryptedCollection.ecoc"
479 }
480 },
481 {
482 "name": "assertCollectionNotExists",
483 "object": "testRunner",
484 "arguments": {
485 "database": "default",
486 "collection": "encryptedCollection"
487 }
488 },
489 {
490 "name": "assertIndexNotExists",
491 "object": "testRunner",
492 "arguments": {
493 "database": "default",
494 "collection": "encryptedCollection",
495 "index": "__safeContent___1"
496 }
497 }
498 ],
499 "expectations": [
500 {
501 "command_started_event": {
502 "command": {
503 "drop": "enxcol_.encryptedCollection.esc"
504 },
505 "command_name": "drop",
506 "database_name": "default"
507 }
508 },
509 {
510 "command_started_event": {
511 "command": {
512 "drop": "enxcol_.encryptedCollection.ecoc"
513 },
514 "command_name": "drop",
515 "database_name": "default"
516 }
517 },
518 {
519 "command_started_event": {
520 "command": {
521 "drop": "encryptedCollection"
522 },
523 "command_name": "drop",
524 "database_name": "default"
525 }
526 },
527 {
528 "command_started_event": {
529 "command": {
530 "create": "enxcol_.encryptedCollection.esc",
531 "clusteredIndex": {
532 "key": {
533 "_id": 1
534 },
535 "unique": true
536 }
537 },
538 "command_name": "create",
539 "database_name": "default"
540 }
541 },
542 {
543 "command_started_event": {
544 "command": {
545 "create": "enxcol_.encryptedCollection.ecoc",
546 "clusteredIndex": {
547 "key": {
548 "_id": 1
549 },
550 "unique": true
551 }
552 },
553 "command_name": "create",
554 "database_name": "default"
555 }
556 },
557 {
558 "command_started_event": {
559 "command": {
560 "create": "encryptedCollection",
561 "encryptedFields": {
562 "fields": [
563 {
564 "path": "firstName",
565 "bsonType": "string",
566 "keyId": {
567 "$binary": {
568 "subType": "04",
569 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
570 }
571 }
572 }
573 ]
574 }
575 },
576 "command_name": "create",
577 "database_name": "default"
578 }
579 },
580 {
581 "command_started_event": {
582 "command": {
583 "createIndexes": "encryptedCollection",
584 "indexes": [
585 {
586 "name": "__safeContent___1",
587 "key": {
588 "__safeContent__": 1
589 }
590 }
591 ]
592 },
593 "command_name": "createIndexes",
594 "database_name": "default"
595 }
596 },
597 {
598 "command_started_event": {
599 "command": {
600 "drop": "enxcol_.encryptedCollection.esc"
601 },
602 "command_name": "drop",
603 "database_name": "default"
604 }
605 },
606 {
607 "command_started_event": {
608 "command": {
609 "drop": "enxcol_.encryptedCollection.ecoc"
610 },
611 "command_name": "drop",
612 "database_name": "default"
613 }
614 },
615 {
616 "command_started_event": {
617 "command": {
618 "drop": "encryptedCollection"
619 },
620 "command_name": "drop",
621 "database_name": "default"
622 }
623 }
624 ]
625 },
626 {
627 "description": "CreateCollection without encryptedFields.",
628 "clientOptions": {
629 "autoEncryptOpts": {
630 "kmsProviders": {
631 "aws": {}
632 },
633 "encryptedFieldsMap": {
634 "default.encryptedCollection": {
635 "fields": [
636 {
637 "path": "firstName",
638 "bsonType": "string",
639 "keyId": {
640 "$binary": {
641 "subType": "04",
642 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
643 }
644 }
645 }
646 ]
647 }
648 }
649 }
650 },
651 "operations": [
652 {
653 "name": "dropCollection",
654 "object": "database",
655 "arguments": {
656 "collection": "plaintextCollection"
657 }
658 },
659 {
660 "name": "createCollection",
661 "object": "database",
662 "arguments": {
663 "collection": "plaintextCollection"
664 }
665 },
666 {
667 "name": "assertCollectionExists",
668 "object": "testRunner",
669 "arguments": {
670 "database": "default",
671 "collection": "plaintextCollection"
672 }
673 }
674 ],
675 "expectations": [
676 {
677 "command_started_event": {
678 "command": {
679 "listCollections": 1,
680 "filter": {
681 "name": "plaintextCollection"
682 }
683 },
684 "command_name": "listCollections",
685 "database_name": "default"
686 }
687 },
688 {
689 "command_started_event": {
690 "command": {
691 "drop": "plaintextCollection"
692 },
693 "command_name": "drop",
694 "database_name": "default"
695 }
696 },
697 {
698 "command_started_event": {
699 "command": {
700 "create": "plaintextCollection"
701 },
702 "command_name": "create",
703 "database_name": "default"
704 }
705 }
706 ]
707 },
708 {
709 "description": "CreateCollection from encryptedFieldsMap.",
710 "clientOptions": {
711 "autoEncryptOpts": {
712 "kmsProviders": {
713 "aws": {}
714 },
715 "encryptedFieldsMap": {
716 "default.encryptedCollection": {
717 "fields": [
718 {
719 "path": "firstName",
720 "bsonType": "string",
721 "keyId": {
722 "$binary": {
723 "subType": "04",
724 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
725 }
726 }
727 }
728 ]
729 }
730 }
731 }
732 },
733 "operations": [
734 {
735 "name": "dropCollection",
736 "object": "database",
737 "arguments": {
738 "collection": "encryptedCollection"
739 }
740 },
741 {
742 "name": "createCollection",
743 "object": "database",
744 "arguments": {
745 "collection": "encryptedCollection"
746 }
747 },
748 {
749 "name": "assertCollectionExists",
750 "object": "testRunner",
751 "arguments": {
752 "database": "default",
753 "collection": "enxcol_.encryptedCollection.esc"
754 }
755 },
756 {
757 "name": "assertCollectionNotExists",
758 "object": "testRunner",
759 "arguments": {
760 "database": "default",
761 "collection": "enxcol_.encryptedCollection.ecc"
762 }
763 },
764 {
765 "name": "assertCollectionExists",
766 "object": "testRunner",
767 "arguments": {
768 "database": "default",
769 "collection": "enxcol_.encryptedCollection.ecoc"
770 }
771 },
772 {
773 "name": "assertCollectionExists",
774 "object": "testRunner",
775 "arguments": {
776 "database": "default",
777 "collection": "encryptedCollection"
778 }
779 },
780 {
781 "name": "assertIndexExists",
782 "object": "testRunner",
783 "arguments": {
784 "database": "default",
785 "collection": "encryptedCollection",
786 "index": "__safeContent___1"
787 }
788 }
789 ],
790 "expectations": [
791 {
792 "command_started_event": {
793 "command": {
794 "drop": "enxcol_.encryptedCollection.esc"
795 },
796 "command_name": "drop",
797 "database_name": "default"
798 }
799 },
800 {
801 "command_started_event": {
802 "command": {
803 "drop": "enxcol_.encryptedCollection.ecoc"
804 },
805 "command_name": "drop",
806 "database_name": "default"
807 }
808 },
809 {
810 "command_started_event": {
811 "command": {
812 "drop": "encryptedCollection"
813 },
814 "command_name": "drop",
815 "database_name": "default"
816 }
817 },
818 {
819 "command_started_event": {
820 "command": {
821 "create": "enxcol_.encryptedCollection.esc",
822 "clusteredIndex": {
823 "key": {
824 "_id": 1
825 },
826 "unique": true
827 }
828 },
829 "command_name": "create",
830 "database_name": "default"
831 }
832 },
833 {
834 "command_started_event": {
835 "command": {
836 "create": "enxcol_.encryptedCollection.ecoc",
837 "clusteredIndex": {
838 "key": {
839 "_id": 1
840 },
841 "unique": true
842 }
843 },
844 "command_name": "create",
845 "database_name": "default"
846 }
847 },
848 {
849 "command_started_event": {
850 "command": {
851 "create": "encryptedCollection",
852 "encryptedFields": {
853 "escCollection": null,
854 "ecocCollection": null,
855 "eccCollection": null,
856 "fields": [
857 {
858 "path": "firstName",
859 "bsonType": "string",
860 "keyId": {
861 "$binary": {
862 "subType": "04",
863 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
864 }
865 }
866 }
867 ]
868 }
869 },
870 "command_name": "create",
871 "database_name": "default"
872 }
873 },
874 {
875 "command_started_event": {
876 "command": {
877 "createIndexes": "encryptedCollection",
878 "indexes": [
879 {
880 "name": "__safeContent___1",
881 "key": {
882 "__safeContent__": 1
883 }
884 }
885 ]
886 },
887 "command_name": "createIndexes",
888 "database_name": "default"
889 }
890 }
891 ]
892 },
893 {
894 "description": "CreateCollection from encryptedFields.",
895 "clientOptions": {
896 "autoEncryptOpts": {
897 "kmsProviders": {
898 "aws": {}
899 }
900 }
901 },
902 "operations": [
903 {
904 "name": "dropCollection",
905 "object": "database",
906 "arguments": {
907 "collection": "encryptedCollection",
908 "encryptedFields": {
909 "fields": [
910 {
911 "path": "firstName",
912 "bsonType": "string",
913 "keyId": {
914 "$binary": {
915 "subType": "04",
916 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
917 }
918 }
919 }
920 ]
921 }
922 }
923 },
924 {
925 "name": "createCollection",
926 "object": "database",
927 "arguments": {
928 "collection": "encryptedCollection",
929 "encryptedFields": {
930 "fields": [
931 {
932 "path": "firstName",
933 "bsonType": "string",
934 "keyId": {
935 "$binary": {
936 "subType": "04",
937 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
938 }
939 }
940 }
941 ]
942 }
943 }
944 },
945 {
946 "name": "assertCollectionExists",
947 "object": "testRunner",
948 "arguments": {
949 "database": "default",
950 "collection": "enxcol_.encryptedCollection.esc"
951 }
952 },
953 {
954 "name": "assertCollectionNotExists",
955 "object": "testRunner",
956 "arguments": {
957 "database": "default",
958 "collection": "enxcol_.encryptedCollection.ecc"
959 }
960 },
961 {
962 "name": "assertCollectionExists",
963 "object": "testRunner",
964 "arguments": {
965 "database": "default",
966 "collection": "enxcol_.encryptedCollection.ecoc"
967 }
968 },
969 {
970 "name": "assertCollectionExists",
971 "object": "testRunner",
972 "arguments": {
973 "database": "default",
974 "collection": "encryptedCollection"
975 }
976 },
977 {
978 "name": "assertIndexExists",
979 "object": "testRunner",
980 "arguments": {
981 "database": "default",
982 "collection": "encryptedCollection",
983 "index": "__safeContent___1"
984 }
985 }
986 ],
987 "expectations": [
988 {
989 "command_started_event": {
990 "command": {
991 "drop": "enxcol_.encryptedCollection.esc"
992 },
993 "command_name": "drop",
994 "database_name": "default"
995 }
996 },
997 {
998 "command_started_event": {
999 "command": {
1000 "drop": "enxcol_.encryptedCollection.ecoc"
1001 },
1002 "command_name": "drop",
1003 "database_name": "default"
1004 }
1005 },
1006 {
1007 "command_started_event": {
1008 "command": {
1009 "drop": "encryptedCollection"
1010 },
1011 "command_name": "drop",
1012 "database_name": "default"
1013 }
1014 },
1015 {
1016 "command_started_event": {
1017 "command": {
1018 "create": "enxcol_.encryptedCollection.esc",
1019 "clusteredIndex": {
1020 "key": {
1021 "_id": 1
1022 },
1023 "unique": true
1024 }
1025 },
1026 "command_name": "create",
1027 "database_name": "default"
1028 }
1029 },
1030 {
1031 "command_started_event": {
1032 "command": {
1033 "create": "enxcol_.encryptedCollection.ecoc",
1034 "clusteredIndex": {
1035 "key": {
1036 "_id": 1
1037 },
1038 "unique": true
1039 }
1040 },
1041 "command_name": "create",
1042 "database_name": "default"
1043 }
1044 },
1045 {
1046 "command_started_event": {
1047 "command": {
1048 "create": "encryptedCollection",
1049 "encryptedFields": {
1050 "escCollection": null,
1051 "ecocCollection": null,
1052 "eccCollection": null,
1053 "fields": [
1054 {
1055 "path": "firstName",
1056 "bsonType": "string",
1057 "keyId": {
1058 "$binary": {
1059 "subType": "04",
1060 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1061 }
1062 }
1063 }
1064 ]
1065 }
1066 },
1067 "command_name": "create",
1068 "database_name": "default"
1069 }
1070 },
1071 {
1072 "command_started_event": {
1073 "command": {
1074 "listCollections": 1,
1075 "filter": {
1076 "name": "encryptedCollection"
1077 }
1078 },
1079 "command_name": "listCollections",
1080 "database_name": "default"
1081 }
1082 },
1083 {
1084 "command_started_event": {
1085 "command": {
1086 "createIndexes": "encryptedCollection",
1087 "indexes": [
1088 {
1089 "name": "__safeContent___1",
1090 "key": {
1091 "__safeContent__": 1
1092 }
1093 }
1094 ]
1095 },
1096 "command_name": "createIndexes",
1097 "database_name": "default"
1098 }
1099 }
1100 ]
1101 },
1102 {
1103 "description": "DropCollection from encryptedFieldsMap",
1104 "clientOptions": {
1105 "autoEncryptOpts": {
1106 "kmsProviders": {
1107 "aws": {}
1108 },
1109 "encryptedFieldsMap": {
1110 "default.encryptedCollection": {
1111 "fields": [
1112 {
1113 "path": "firstName",
1114 "bsonType": "string",
1115 "keyId": {
1116 "$binary": {
1117 "subType": "04",
1118 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1119 }
1120 }
1121 }
1122 ]
1123 }
1124 }
1125 }
1126 },
1127 "operations": [
1128 {
1129 "name": "dropCollection",
1130 "object": "database",
1131 "arguments": {
1132 "collection": "encryptedCollection"
1133 }
1134 }
1135 ],
1136 "expectations": [
1137 {
1138 "command_started_event": {
1139 "command": {
1140 "drop": "enxcol_.encryptedCollection.esc"
1141 },
1142 "command_name": "drop",
1143 "database_name": "default"
1144 }
1145 },
1146 {
1147 "command_started_event": {
1148 "command": {
1149 "drop": "enxcol_.encryptedCollection.ecoc"
1150 },
1151 "command_name": "drop",
1152 "database_name": "default"
1153 }
1154 },
1155 {
1156 "command_started_event": {
1157 "command": {
1158 "drop": "encryptedCollection"
1159 },
1160 "command_name": "drop",
1161 "database_name": "default"
1162 }
1163 }
1164 ]
1165 },
1166 {
1167 "description": "DropCollection from encryptedFields",
1168 "clientOptions": {
1169 "autoEncryptOpts": {
1170 "kmsProviders": {
1171 "aws": {}
1172 },
1173 "encryptedFieldsMap": {}
1174 }
1175 },
1176 "operations": [
1177 {
1178 "name": "dropCollection",
1179 "object": "database",
1180 "arguments": {
1181 "collection": "encryptedCollection",
1182 "encryptedFields": {
1183 "fields": [
1184 {
1185 "path": "firstName",
1186 "bsonType": "string",
1187 "keyId": {
1188 "$binary": {
1189 "subType": "04",
1190 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1191 }
1192 }
1193 }
1194 ]
1195 }
1196 }
1197 },
1198 {
1199 "name": "createCollection",
1200 "object": "database",
1201 "arguments": {
1202 "collection": "encryptedCollection",
1203 "encryptedFields": {
1204 "fields": [
1205 {
1206 "path": "firstName",
1207 "bsonType": "string",
1208 "keyId": {
1209 "$binary": {
1210 "subType": "04",
1211 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1212 }
1213 }
1214 }
1215 ]
1216 }
1217 }
1218 },
1219 {
1220 "name": "assertCollectionExists",
1221 "object": "testRunner",
1222 "arguments": {
1223 "database": "default",
1224 "collection": "enxcol_.encryptedCollection.esc"
1225 }
1226 },
1227 {
1228 "name": "assertCollectionNotExists",
1229 "object": "testRunner",
1230 "arguments": {
1231 "database": "default",
1232 "collection": "enxcol_.encryptedCollection.ecc"
1233 }
1234 },
1235 {
1236 "name": "assertCollectionExists",
1237 "object": "testRunner",
1238 "arguments": {
1239 "database": "default",
1240 "collection": "enxcol_.encryptedCollection.ecoc"
1241 }
1242 },
1243 {
1244 "name": "assertCollectionExists",
1245 "object": "testRunner",
1246 "arguments": {
1247 "database": "default",
1248 "collection": "encryptedCollection"
1249 }
1250 },
1251 {
1252 "name": "assertIndexExists",
1253 "object": "testRunner",
1254 "arguments": {
1255 "database": "default",
1256 "collection": "encryptedCollection",
1257 "index": "__safeContent___1"
1258 }
1259 },
1260 {
1261 "name": "dropCollection",
1262 "object": "database",
1263 "arguments": {
1264 "collection": "encryptedCollection",
1265 "encryptedFields": {
1266 "fields": [
1267 {
1268 "path": "firstName",
1269 "bsonType": "string",
1270 "keyId": {
1271 "$binary": {
1272 "subType": "04",
1273 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1274 }
1275 }
1276 }
1277 ]
1278 }
1279 }
1280 },
1281 {
1282 "name": "assertCollectionNotExists",
1283 "object": "testRunner",
1284 "arguments": {
1285 "database": "default",
1286 "collection": "enxcol_.encryptedCollection.esc"
1287 }
1288 },
1289 {
1290 "name": "assertCollectionNotExists",
1291 "object": "testRunner",
1292 "arguments": {
1293 "database": "default",
1294 "collection": "enxcol_.encryptedCollection.ecoc"
1295 }
1296 },
1297 {
1298 "name": "assertCollectionNotExists",
1299 "object": "testRunner",
1300 "arguments": {
1301 "database": "default",
1302 "collection": "encryptedCollection"
1303 }
1304 }
1305 ],
1306 "expectations": [
1307 {
1308 "command_started_event": {
1309 "command": {
1310 "drop": "enxcol_.encryptedCollection.esc"
1311 },
1312 "command_name": "drop",
1313 "database_name": "default"
1314 }
1315 },
1316 {
1317 "command_started_event": {
1318 "command": {
1319 "drop": "enxcol_.encryptedCollection.ecoc"
1320 },
1321 "command_name": "drop",
1322 "database_name": "default"
1323 }
1324 },
1325 {
1326 "command_started_event": {
1327 "command": {
1328 "drop": "encryptedCollection"
1329 },
1330 "command_name": "drop",
1331 "database_name": "default"
1332 }
1333 },
1334 {
1335 "command_started_event": {
1336 "command": {
1337 "create": "enxcol_.encryptedCollection.esc",
1338 "clusteredIndex": {
1339 "key": {
1340 "_id": 1
1341 },
1342 "unique": true
1343 }
1344 },
1345 "command_name": "create",
1346 "database_name": "default"
1347 }
1348 },
1349 {
1350 "command_started_event": {
1351 "command": {
1352 "create": "enxcol_.encryptedCollection.ecoc",
1353 "clusteredIndex": {
1354 "key": {
1355 "_id": 1
1356 },
1357 "unique": true
1358 }
1359 },
1360 "command_name": "create",
1361 "database_name": "default"
1362 }
1363 },
1364 {
1365 "command_started_event": {
1366 "command": {
1367 "create": "encryptedCollection",
1368 "encryptedFields": {
1369 "escCollection": null,
1370 "ecocCollection": null,
1371 "eccCollection": null,
1372 "fields": [
1373 {
1374 "path": "firstName",
1375 "bsonType": "string",
1376 "keyId": {
1377 "$binary": {
1378 "subType": "04",
1379 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1380 }
1381 }
1382 }
1383 ]
1384 }
1385 },
1386 "command_name": "create",
1387 "database_name": "default"
1388 }
1389 },
1390 {
1391 "command_started_event": {
1392 "command": {
1393 "listCollections": 1,
1394 "filter": {
1395 "name": "encryptedCollection"
1396 }
1397 },
1398 "command_name": "listCollections",
1399 "database_name": "default"
1400 }
1401 },
1402 {
1403 "command_started_event": {
1404 "command": {
1405 "createIndexes": "encryptedCollection",
1406 "indexes": [
1407 {
1408 "name": "__safeContent___1",
1409 "key": {
1410 "__safeContent__": 1
1411 }
1412 }
1413 ]
1414 },
1415 "command_name": "createIndexes",
1416 "database_name": "default"
1417 }
1418 },
1419 {
1420 "command_started_event": {
1421 "command": {
1422 "drop": "enxcol_.encryptedCollection.esc"
1423 },
1424 "command_name": "drop",
1425 "database_name": "default"
1426 }
1427 },
1428 {
1429 "command_started_event": {
1430 "command": {
1431 "drop": "enxcol_.encryptedCollection.ecoc"
1432 },
1433 "command_name": "drop",
1434 "database_name": "default"
1435 }
1436 },
1437 {
1438 "command_started_event": {
1439 "command": {
1440 "drop": "encryptedCollection"
1441 },
1442 "command_name": "drop",
1443 "database_name": "default"
1444 }
1445 }
1446 ]
1447 },
1448 {
1449 "description": "DropCollection from remote encryptedFields",
1450 "clientOptions": {
1451 "autoEncryptOpts": {
1452 "kmsProviders": {
1453 "aws": {}
1454 },
1455 "encryptedFieldsMap": {}
1456 }
1457 },
1458 "operations": [
1459 {
1460 "name": "dropCollection",
1461 "object": "database",
1462 "arguments": {
1463 "collection": "encryptedCollection",
1464 "encryptedFields": {
1465 "fields": [
1466 {
1467 "path": "firstName",
1468 "bsonType": "string",
1469 "keyId": {
1470 "$binary": {
1471 "subType": "04",
1472 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1473 }
1474 }
1475 }
1476 ]
1477 }
1478 }
1479 },
1480 {
1481 "name": "createCollection",
1482 "object": "database",
1483 "arguments": {
1484 "collection": "encryptedCollection",
1485 "encryptedFields": {
1486 "fields": [
1487 {
1488 "path": "firstName",
1489 "bsonType": "string",
1490 "keyId": {
1491 "$binary": {
1492 "subType": "04",
1493 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1494 }
1495 }
1496 }
1497 ]
1498 }
1499 }
1500 },
1501 {
1502 "name": "assertCollectionExists",
1503 "object": "testRunner",
1504 "arguments": {
1505 "database": "default",
1506 "collection": "enxcol_.encryptedCollection.esc"
1507 }
1508 },
1509 {
1510 "name": "assertCollectionNotExists",
1511 "object": "testRunner",
1512 "arguments": {
1513 "database": "default",
1514 "collection": "enxcol_.encryptedCollection.ecc"
1515 }
1516 },
1517 {
1518 "name": "assertCollectionExists",
1519 "object": "testRunner",
1520 "arguments": {
1521 "database": "default",
1522 "collection": "enxcol_.encryptedCollection.ecoc"
1523 }
1524 },
1525 {
1526 "name": "assertCollectionExists",
1527 "object": "testRunner",
1528 "arguments": {
1529 "database": "default",
1530 "collection": "encryptedCollection"
1531 }
1532 },
1533 {
1534 "name": "assertIndexExists",
1535 "object": "testRunner",
1536 "arguments": {
1537 "database": "default",
1538 "collection": "encryptedCollection",
1539 "index": "__safeContent___1"
1540 }
1541 },
1542 {
1543 "name": "dropCollection",
1544 "object": "database",
1545 "arguments": {
1546 "collection": "encryptedCollection"
1547 }
1548 },
1549 {
1550 "name": "assertCollectionNotExists",
1551 "object": "testRunner",
1552 "arguments": {
1553 "database": "default",
1554 "collection": "enxcol_.encryptedCollection.esc"
1555 }
1556 },
1557 {
1558 "name": "assertCollectionNotExists",
1559 "object": "testRunner",
1560 "arguments": {
1561 "database": "default",
1562 "collection": "enxcol_.encryptedCollection.ecoc"
1563 }
1564 },
1565 {
1566 "name": "assertCollectionNotExists",
1567 "object": "testRunner",
1568 "arguments": {
1569 "database": "default",
1570 "collection": "encryptedCollection"
1571 }
1572 }
1573 ],
1574 "expectations": [
1575 {
1576 "command_started_event": {
1577 "command": {
1578 "drop": "enxcol_.encryptedCollection.esc"
1579 },
1580 "command_name": "drop",
1581 "database_name": "default"
1582 }
1583 },
1584 {
1585 "command_started_event": {
1586 "command": {
1587 "drop": "enxcol_.encryptedCollection.ecoc"
1588 },
1589 "command_name": "drop",
1590 "database_name": "default"
1591 }
1592 },
1593 {
1594 "command_started_event": {
1595 "command": {
1596 "drop": "encryptedCollection"
1597 },
1598 "command_name": "drop",
1599 "database_name": "default"
1600 }
1601 },
1602 {
1603 "command_started_event": {
1604 "command": {
1605 "create": "enxcol_.encryptedCollection.esc",
1606 "clusteredIndex": {
1607 "key": {
1608 "_id": 1
1609 },
1610 "unique": true
1611 }
1612 },
1613 "command_name": "create",
1614 "database_name": "default"
1615 }
1616 },
1617 {
1618 "command_started_event": {
1619 "command": {
1620 "create": "enxcol_.encryptedCollection.ecoc",
1621 "clusteredIndex": {
1622 "key": {
1623 "_id": 1
1624 },
1625 "unique": true
1626 }
1627 },
1628 "command_name": "create",
1629 "database_name": "default"
1630 }
1631 },
1632 {
1633 "command_started_event": {
1634 "command": {
1635 "create": "encryptedCollection",
1636 "encryptedFields": {
1637 "escCollection": null,
1638 "ecocCollection": null,
1639 "eccCollection": null,
1640 "fields": [
1641 {
1642 "path": "firstName",
1643 "bsonType": "string",
1644 "keyId": {
1645 "$binary": {
1646 "subType": "04",
1647 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1648 }
1649 }
1650 }
1651 ]
1652 }
1653 },
1654 "command_name": "create",
1655 "database_name": "default"
1656 }
1657 },
1658 {
1659 "command_started_event": {
1660 "command": {
1661 "listCollections": 1,
1662 "filter": {
1663 "name": "encryptedCollection"
1664 }
1665 },
1666 "command_name": "listCollections",
1667 "database_name": "default"
1668 }
1669 },
1670 {
1671 "command_started_event": {
1672 "command": {
1673 "createIndexes": "encryptedCollection",
1674 "indexes": [
1675 {
1676 "name": "__safeContent___1",
1677 "key": {
1678 "__safeContent__": 1
1679 }
1680 }
1681 ]
1682 },
1683 "command_name": "createIndexes",
1684 "database_name": "default"
1685 }
1686 },
1687 {
1688 "command_started_event": {
1689 "command": {
1690 "listCollections": 1,
1691 "filter": {
1692 "name": "encryptedCollection"
1693 }
1694 },
1695 "command_name": "listCollections",
1696 "database_name": "default"
1697 }
1698 },
1699 {
1700 "command_started_event": {
1701 "command": {
1702 "drop": "enxcol_.encryptedCollection.esc"
1703 },
1704 "command_name": "drop",
1705 "database_name": "default"
1706 }
1707 },
1708 {
1709 "command_started_event": {
1710 "command": {
1711 "drop": "enxcol_.encryptedCollection.ecoc"
1712 },
1713 "command_name": "drop",
1714 "database_name": "default"
1715 }
1716 },
1717 {
1718 "command_started_event": {
1719 "command": {
1720 "drop": "encryptedCollection"
1721 },
1722 "command_name": "drop",
1723 "database_name": "default"
1724 }
1725 }
1726 ]
1727 },
1728 {
1729 "description": "encryptedFields are consulted for metadata collection names",
1730 "clientOptions": {
1731 "autoEncryptOpts": {
1732 "kmsProviders": {
1733 "aws": {}
1734 },
1735 "encryptedFieldsMap": {
1736 "default.encryptedCollection": {
1737 "escCollection": "invalid_esc_name",
1738 "ecocCollection": "invalid_ecoc_name",
1739 "fields": [
1740 {
1741 "path": "firstName",
1742 "bsonType": "string",
1743 "keyId": {
1744 "$binary": {
1745 "subType": "04",
1746 "base64": "AAAAAAAAAAAAAAAAAAAAAA=="
1747 }
1748 }
1749 }
1750 ]
1751 }
1752 }
1753 }
1754 },
1755 "operations": [
1756 {
1757 "name": "dropCollection",
1758 "object": "database",
1759 "arguments": {
1760 "collection": "encryptedCollection"
1761 }
1762 },
1763 {
1764 "name": "createCollection",
1765 "object": "database",
1766 "arguments": {
1767 "collection": "encryptedCollection"
1768 },
1769 "result": {
1770 "errorContains": "Encrypted State Collection name should follow"
1771 }
1772 }
1773 ]
1774 }
1775 ]
1776}
View as plain text