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 encryption using key alt name",
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_w_altname": "string0",
117 "altname": "altname"
118 }
119 }
120 }
121 ],
122 "expectations": [
123 {
124 "command_started_event": {
125 "command": {
126 "listCollections": 1,
127 "filter": {
128 "name": "default"
129 }
130 },
131 "command_name": "listCollections"
132 }
133 },
134 {
135 "command_started_event": {
136 "command": {
137 "find": "datakeys",
138 "filter": {
139 "$or": [
140 {
141 "_id": {
142 "$in": []
143 }
144 },
145 {
146 "keyAltNames": {
147 "$in": [
148 "altname"
149 ]
150 }
151 }
152 ]
153 },
154 "$db": "keyvault",
155 "readConcern": {
156 "level": "majority"
157 }
158 },
159 "command_name": "find"
160 }
161 },
162 {
163 "command_started_event": {
164 "command": {
165 "insert": "default",
166 "documents": [
167 {
168 "_id": 1,
169 "encrypted_w_altname": {
170 "$$type": "binData"
171 },
172 "altname": "altname"
173 }
174 ],
175 "ordered": true
176 },
177 "command_name": "insert"
178 }
179 }
180 ],
181 "outcome": {
182 "collection": {
183 "data": [
184 {
185 "_id": 1,
186 "encrypted_w_altname": {
187 "$$type": "binData"
188 },
189 "altname": "altname"
190 }
191 ]
192 }
193 }
194 },
195 {
196 "description": "Replace with key alt name fails",
197 "clientOptions": {
198 "autoEncryptOpts": {
199 "kmsProviders": {
200 "aws": {}
201 }
202 }
203 },
204 "operations": [
205 {
206 "name": "updateOne",
207 "arguments": {
208 "filter": {},
209 "update": {
210 "$set": {
211 "encrypted_w_altname": "string0"
212 }
213 },
214 "upsert": true
215 },
216 "result": {
217 "errorContains": "A non-static (JSONPointer) keyId is not supported"
218 }
219 }
220 ],
221 "outcome": {
222 "collection": {
223 "data": []
224 }
225 }
226 }
227 ]
228}
View as plain text