1{
2 "runOn": [
3 {
4 "minServerVersion": "7.0.0"
5 }
6 ],
7 "database_name": "default",
8 "collection_name": "default",
9 "data": [
10 {
11 "_id": 1,
12 "encrypted_string": {
13 "$binary": {
14 "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
15 "subType": "06"
16 }
17 }
18 },
19 {
20 "_id": 2,
21 "encrypted_string": {
22 "$binary": {
23 "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
24 "subType": "06"
25 }
26 }
27 }
28 ],
29 "json_schema": {
30 "properties": {
31 "encrypted_w_altname": {
32 "encrypt": {
33 "keyId": "/altname",
34 "bsonType": "string",
35 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
36 }
37 },
38 "encrypted_string": {
39 "encrypt": {
40 "keyId": [
41 {
42 "$binary": {
43 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
44 "subType": "04"
45 }
46 }
47 ],
48 "bsonType": "string",
49 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
50 }
51 },
52 "random": {
53 "encrypt": {
54 "keyId": [
55 {
56 "$binary": {
57 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
58 "subType": "04"
59 }
60 }
61 ],
62 "bsonType": "string",
63 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
64 }
65 },
66 "encrypted_string_equivalent": {
67 "encrypt": {
68 "keyId": [
69 {
70 "$binary": {
71 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
72 "subType": "04"
73 }
74 }
75 ],
76 "bsonType": "string",
77 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
78 }
79 }
80 },
81 "bsonType": "object"
82 },
83 "key_vault_data": [
84 {
85 "status": 1,
86 "_id": {
87 "$binary": {
88 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
89 "subType": "04"
90 }
91 },
92 "masterKey": {
93 "provider": "aws",
94 "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
95 "region": "us-east-1"
96 },
97 "updateDate": {
98 "$date": {
99 "$numberLong": "1552949630483"
100 }
101 },
102 "keyMaterial": {
103 "$binary": {
104 "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO",
105 "subType": "00"
106 }
107 },
108 "creationDate": {
109 "$date": {
110 "$numberLong": "1552949630483"
111 }
112 },
113 "keyAltNames": [
114 "altname",
115 "another_altname"
116 ]
117 }
118 ],
119 "tests": [
120 {
121 "description": "Explain a find with deterministic encryption",
122 "clientOptions": {
123 "autoEncryptOpts": {
124 "kmsProviders": {
125 "aws": {}
126 }
127 }
128 },
129 "operations": [
130 {
131 "name": "runCommand",
132 "object": "database",
133 "command_name": "explain",
134 "arguments": {
135 "command": {
136 "explain": {
137 "find": "default",
138 "filter": {
139 "encrypted_string": "string1"
140 }
141 }
142 }
143 }
144 }
145 ],
146 "expectations": [
147 {
148 "command_started_event": {
149 "command": {
150 "listCollections": 1,
151 "filter": {
152 "name": "default"
153 }
154 },
155 "command_name": "listCollections"
156 }
157 },
158 {
159 "command_started_event": {
160 "command": {
161 "find": "datakeys",
162 "filter": {
163 "$or": [
164 {
165 "_id": {
166 "$in": [
167 {
168 "$binary": {
169 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
170 "subType": "04"
171 }
172 }
173 ]
174 }
175 },
176 {
177 "keyAltNames": {
178 "$in": []
179 }
180 }
181 ]
182 },
183 "$db": "keyvault",
184 "readConcern": {
185 "level": "majority"
186 }
187 },
188 "command_name": "find"
189 }
190 },
191 {
192 "command_started_event": {
193 "command": {
194 "explain": {
195 "find": "default",
196 "filter": {
197 "encrypted_string": {
198 "$eq": {
199 "$binary": {
200 "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
201 "subType": "06"
202 }
203 }
204 }
205 }
206 },
207 "verbosity": "allPlansExecution"
208 },
209 "command_name": "explain"
210 }
211 }
212 ],
213 "outcome": {
214 "collection": {
215 "data": [
216 {
217 "_id": 1,
218 "encrypted_string": {
219 "$binary": {
220 "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
221 "subType": "06"
222 }
223 }
224 },
225 {
226 "_id": 2,
227 "encrypted_string": {
228 "$binary": {
229 "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==",
230 "subType": "06"
231 }
232 }
233 }
234 ]
235 }
236 }
237 }
238 ]
239}
View as plain text