1{
2 "runOn": [
3 {
4 "minServerVersion": "4.1.10"
5 }
6 ],
7 "database_name": "default",
8 "collection_name": "default",
9 "data": [],
10 "json_schema": {
11 "properties": {
12 "encrypted_w_altname": {
13 "encrypt": {
14 "keyId": "/altname",
15 "bsonType": "string",
16 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
17 }
18 },
19 "encrypted_string": {
20 "encrypt": {
21 "keyId": [
22 {
23 "$binary": {
24 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
25 "subType": "04"
26 }
27 }
28 ],
29 "bsonType": "string",
30 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
31 }
32 },
33 "random": {
34 "encrypt": {
35 "keyId": [
36 {
37 "$binary": {
38 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
39 "subType": "04"
40 }
41 }
42 ],
43 "bsonType": "string",
44 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
45 }
46 },
47 "encrypted_string_equivalent": {
48 "encrypt": {
49 "keyId": [
50 {
51 "$binary": {
52 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
53 "subType": "04"
54 }
55 }
56 ],
57 "bsonType": "string",
58 "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
59 }
60 }
61 },
62 "bsonType": "object"
63 },
64 "key_vault_data": [
65 {
66 "status": 1,
67 "_id": {
68 "$binary": {
69 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
70 "subType": "04"
71 }
72 },
73 "masterKey": {
74 "provider": "aws",
75 "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
76 "region": "us-east-1"
77 },
78 "updateDate": {
79 "$date": {
80 "$numberLong": "1552949630483"
81 }
82 },
83 "keyMaterial": {
84 "$binary": {
85 "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO",
86 "subType": "00"
87 }
88 },
89 "creationDate": {
90 "$date": {
91 "$numberLong": "1552949630483"
92 }
93 },
94 "keyAltNames": [
95 "altname",
96 "another_altname"
97 ]
98 }
99 ],
100 "tests": [
101 {
102 "description": "Insert with deterministic encryption, then find it",
103 "clientOptions": {
104 "autoEncryptOpts": {
105 "kmsProviders": {
106 "aws": {}
107 }
108 }
109 },
110 "operations": [
111 {
112 "name": "insertOne",
113 "arguments": {
114 "document": {
115 "_id": 1,
116 "encrypted_string": "string0"
117 }
118 }
119 },
120 {
121 "name": "find",
122 "arguments": {
123 "filter": {
124 "_id": 1
125 }
126 },
127 "result": [
128 {
129 "_id": 1,
130 "encrypted_string": "string0"
131 }
132 ]
133 }
134 ],
135 "expectations": [
136 {
137 "command_started_event": {
138 "command": {
139 "listCollections": 1,
140 "filter": {
141 "name": "default"
142 }
143 },
144 "command_name": "listCollections"
145 }
146 },
147 {
148 "command_started_event": {
149 "command": {
150 "find": "datakeys",
151 "filter": {
152 "$or": [
153 {
154 "_id": {
155 "$in": [
156 {
157 "$binary": {
158 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
159 "subType": "04"
160 }
161 }
162 ]
163 }
164 },
165 {
166 "keyAltNames": {
167 "$in": []
168 }
169 }
170 ]
171 },
172 "$db": "keyvault",
173 "readConcern": {
174 "level": "majority"
175 }
176 },
177 "command_name": "find"
178 }
179 },
180 {
181 "command_started_event": {
182 "command": {
183 "insert": "default",
184 "documents": [
185 {
186 "_id": 1,
187 "encrypted_string": {
188 "$binary": {
189 "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
190 "subType": "06"
191 }
192 }
193 }
194 ],
195 "ordered": true
196 },
197 "command_name": "insert"
198 }
199 },
200 {
201 "command_started_event": {
202 "command": {
203 "find": "default",
204 "filter": {
205 "_id": 1
206 }
207 },
208 "command_name": "find"
209 }
210 }
211 ],
212 "outcome": {
213 "collection": {
214 "data": [
215 {
216 "_id": 1,
217 "encrypted_string": {
218 "$binary": {
219 "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==",
220 "subType": "06"
221 }
222 }
223 }
224 ]
225 }
226 }
227 },
228 {
229 "description": "Insert with randomized encryption, then find it",
230 "clientOptions": {
231 "autoEncryptOpts": {
232 "kmsProviders": {
233 "aws": {}
234 }
235 }
236 },
237 "operations": [
238 {
239 "name": "insertOne",
240 "arguments": {
241 "document": {
242 "_id": 1,
243 "random": "123"
244 }
245 }
246 },
247 {
248 "name": "find",
249 "arguments": {
250 "filter": {
251 "_id": 1
252 }
253 },
254 "result": [
255 {
256 "_id": 1,
257 "random": "123"
258 }
259 ]
260 }
261 ],
262 "expectations": [
263 {
264 "command_started_event": {
265 "command": {
266 "listCollections": 1,
267 "filter": {
268 "name": "default"
269 }
270 },
271 "command_name": "listCollections"
272 }
273 },
274 {
275 "command_started_event": {
276 "command": {
277 "find": "datakeys",
278 "filter": {
279 "$or": [
280 {
281 "_id": {
282 "$in": [
283 {
284 "$binary": {
285 "base64": "AAAAAAAAAAAAAAAAAAAAAA==",
286 "subType": "04"
287 }
288 }
289 ]
290 }
291 },
292 {
293 "keyAltNames": {
294 "$in": []
295 }
296 }
297 ]
298 },
299 "$db": "keyvault",
300 "readConcern": {
301 "level": "majority"
302 }
303 },
304 "command_name": "find"
305 }
306 },
307 {
308 "command_started_event": {
309 "command": {
310 "insert": "default",
311 "documents": [
312 {
313 "_id": 1,
314 "random": {
315 "$$type": "binData"
316 }
317 }
318 ],
319 "ordered": true
320 },
321 "command_name": "insert"
322 }
323 },
324 {
325 "command_started_event": {
326 "command": {
327 "find": "default",
328 "filter": {
329 "_id": 1
330 }
331 },
332 "command_name": "find"
333 }
334 }
335 ],
336 "outcome": {
337 "collection": {
338 "data": [
339 {
340 "_id": 1,
341 "random": {
342 "$$type": "binData"
343 }
344 }
345 ]
346 }
347 }
348 }
349 ]
350}
View as plain text