Skip to content

Commit eb3d882

Browse files
authored
DRIVERS-2524 fix commandStarted events with encryptionInformation (#1405)
* add escCollection and ecocCollection to commandStarted events escCollection and ecocCollection are appended by libmongocrypt * fix indent of encryptionInformation * add missing `ordered: true` * regenerate tests
1 parent 73fddca commit eb3d882

File tree

126 files changed

+1848
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+1848
-593
lines changed

source/client-side-encryption/etc/test-templates/fle2v2-BypassQueryAnalysis.yml.template

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ tests:
4848
documents:
4949
- *doc0_encrypted
5050
ordered: true
51+
encryptionInformation:
52+
type: 1
53+
schema:
54+
"default.default":
55+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
56+
escCollection: "enxcol_.default.esc"
57+
ecocCollection: "enxcol_.default.ecoc"
58+
<<: *encrypted_fields
5159
command_name: insert
5260
- command_started_event:
5361
command:

source/client-side-encryption/etc/test-templates/fle2v2-Delete.yml.template

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ tests:
6363
encryptionInformation:
6464
type: 1
6565
schema:
66-
"default.default": *encrypted_fields
66+
"default.default":
67+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
68+
escCollection: "enxcol_.default.esc"
69+
ecocCollection: "enxcol_.default.ecoc"
70+
<<: *encrypted_fields
6771
command_name: insert
6872
- command_started_event:
6973
command:
@@ -82,10 +86,15 @@ tests:
8286
},
8387
"limit": 1
8488
}
89+
ordered: true
8590
encryptionInformation:
8691
type: 1
8792
schema:
88-
"default.default": *encrypted_fields
93+
"default.default":
94+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
95+
escCollection: "enxcol_.default.esc"
96+
ecocCollection: "enxcol_.default.ecoc"
97+
<<: *encrypted_fields
8998
command_name: delete
9099
outcome:
91100
collection:

source/client-side-encryption/etc/test-templates/fle2v2-EncryptedFields-vs-jsonSchema.yml.template

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ tests:
6666
encryptionInformation:
6767
type: 1
6868
schema:
69-
"default.default": *encrypted_fields
69+
"default.default":
70+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
71+
escCollection: "enxcol_.default.esc"
72+
ecocCollection: "enxcol_.default.ecoc"
73+
<<: *encrypted_fields
74+
7075
command_name: insert
7176
- command_started_event:
7277
command:
@@ -84,7 +89,12 @@ tests:
8489
encryptionInformation:
8590
type: 1
8691
schema:
87-
"default.default": *encrypted_fields
92+
"default.default":
93+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
94+
escCollection: "enxcol_.default.esc"
95+
ecocCollection: "enxcol_.default.ecoc"
96+
<<: *encrypted_fields
97+
8898
command_name: find
8999
outcome:
90100
collection:

source/client-side-encryption/etc/test-templates/fle2v2-EncryptedFieldsMap-defaults.yml.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ tests:
4545
},
4646
"schema": {
4747
"default.default": {
48+
"escCollection": "enxcol_.default.esc",
49+
"ecocCollection": "enxcol_.default.ecoc",
4850
"fields": []
4951
}
5052
}

source/client-side-encryption/etc/test-templates/fle2v2-FindOneAndUpdate.yml.template

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ tests:
6464
encryptionInformation:
6565
type: 1
6666
schema:
67-
"default.default": *encrypted_fields
67+
"default.default":
68+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
69+
escCollection: "enxcol_.default.esc"
70+
ecocCollection: "enxcol_.default.ecoc"
71+
<<: *encrypted_fields
72+
6873
command_name: insert
6974
- command_started_event:
7075
command:
@@ -83,7 +88,12 @@ tests:
8388
encryptionInformation:
8489
type: 1
8590
schema:
86-
"default.default": *encrypted_fields
91+
"default.default":
92+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
93+
escCollection: "enxcol_.default.esc"
94+
ecocCollection: "enxcol_.default.ecoc"
95+
<<: *encrypted_fields
96+
8797
command_name: findAndModify
8898
outcome:
8999
collection:
@@ -148,7 +158,12 @@ tests:
148158
encryptionInformation:
149159
type: 1
150160
schema:
151-
"default.default": *encrypted_fields
161+
"default.default":
162+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
163+
escCollection: "enxcol_.default.esc"
164+
ecocCollection: "enxcol_.default.ecoc"
165+
<<: *encrypted_fields
166+
152167
command_name: insert
153168

154169
- command_started_event:
@@ -168,7 +183,12 @@ tests:
168183
encryptionInformation:
169184
type: 1
170185
schema:
171-
"default.default": *encrypted_fields
186+
"default.default":
187+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
188+
escCollection: "enxcol_.default.esc"
189+
ecocCollection: "enxcol_.default.ecoc"
190+
<<: *encrypted_fields
191+
172192
command_name: findAndModify
173193
- command_started_event:
174194
command:

source/client-side-encryption/etc/test-templates/fle2v2-InsertFind-Indexed.yml.template

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ tests:
6262
encryptionInformation:
6363
type: 1
6464
schema:
65-
default.default: *encrypted_fields
65+
default.default:
66+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
67+
escCollection: "enxcol_.default.esc"
68+
ecocCollection: "enxcol_.default.ecoc"
69+
<<: *encrypted_fields
6670
command_name: insert
6771
- command_started_event:
6872
command:
@@ -80,7 +84,11 @@ tests:
8084
encryptionInformation:
8185
type: 1
8286
schema:
83-
default.default: *encrypted_fields
87+
default.default:
88+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
89+
escCollection: "enxcol_.default.esc"
90+
ecocCollection: "enxcol_.default.ecoc"
91+
<<: *encrypted_fields
8492
command_name: find
8593
outcome:
8694
collection:

source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Aggregate.yml.template

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ tests:
6666
encryptionInformation:
6767
type: 1
6868
schema:
69-
default.default: *encrypted_fields
69+
default.default:
70+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
71+
escCollection: "enxcol_.default.esc"
72+
ecocCollection: "enxcol_.default.ecoc"
73+
<<: *encrypted_fields
7074
command_name: insert
7175
- command_started_event:
7276
command:
@@ -77,7 +81,11 @@ tests:
7781
encryptionInformation:
7882
type: 1
7983
schema:
80-
default.default: *encrypted_fields
84+
default.default:
85+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
86+
escCollection: "enxcol_.default.esc"
87+
ecocCollection: "enxcol_.default.ecoc"
88+
<<: *encrypted_fields
8189
command_name: insert
8290
- command_started_event:
8391
command:
@@ -100,7 +108,11 @@ tests:
100108
encryptionInformation:
101109
type: 1
102110
schema:
103-
default.default: *encrypted_fields
111+
default.default:
112+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
113+
escCollection: "enxcol_.default.esc"
114+
ecocCollection: "enxcol_.default.ecoc"
115+
<<: *encrypted_fields
104116
command_name: aggregate
105117
outcome:
106118
collection:

source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-Delete.yml.template

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ tests:
6767
encryptionInformation:
6868
type: 1
6969
schema:
70-
default.default: *encrypted_fields
70+
default.default:
71+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
72+
escCollection: "enxcol_.default.esc"
73+
ecocCollection: "enxcol_.default.ecoc"
74+
<<: *encrypted_fields
7175
command_name: insert
7276
- command_started_event:
7377
command:
@@ -78,7 +82,11 @@ tests:
7882
encryptionInformation:
7983
type: 1
8084
schema:
81-
default.default: *encrypted_fields
85+
default.default:
86+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
87+
escCollection: "enxcol_.default.esc"
88+
ecocCollection: "enxcol_.default.ecoc"
89+
<<: *encrypted_fields
8290
command_name: insert
8391
- command_started_event:
8492
command:
@@ -98,10 +106,15 @@ tests:
98106
"limit": 1
99107
}
100108
]
109+
ordered: true
101110
encryptionInformation:
102111
type: 1
103112
schema:
104-
default.default: *encrypted_fields
113+
default.default:
114+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
115+
escCollection: "enxcol_.default.esc"
116+
ecocCollection: "enxcol_.default.ecoc"
117+
<<: *encrypted_fields
105118
command_name: delete
106119
outcome:
107120
collection:

source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-FindOneAndUpdate.yml.template

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ tests:
6868
encryptionInformation:
6969
type: 1
7070
schema:
71-
default.default: *encrypted_fields
71+
default.default:
72+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
73+
escCollection: "enxcol_.default.esc"
74+
ecocCollection: "enxcol_.default.ecoc"
75+
<<: *encrypted_fields
7276
command_name: insert
7377
- command_started_event:
7478
command:
@@ -79,7 +83,11 @@ tests:
7983
encryptionInformation:
8084
type: 1
8185
schema:
82-
default.default: *encrypted_fields
86+
default.default:
87+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
88+
escCollection: "enxcol_.default.esc"
89+
ecocCollection: "enxcol_.default.ecoc"
90+
<<: *encrypted_fields
8391
command_name: insert
8492
- command_started_event:
8593
command:
@@ -98,7 +106,11 @@ tests:
98106
encryptionInformation:
99107
type: 1
100108
schema:
101-
default.default: *encrypted_fields
109+
default.default:
110+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
111+
escCollection: "enxcol_.default.esc"
112+
ecocCollection: "enxcol_.default.ecoc"
113+
<<: *encrypted_fields
102114
command_name: findAndModify
103115
outcome:
104116
collection:

source/client-side-encryption/etc/test-templates/fle2v2-Range-Date-InsertFind.yml.template

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ tests:
6666
encryptionInformation:
6767
type: 1
6868
schema:
69-
default.default: *encrypted_fields
69+
default.default:
70+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
71+
escCollection: "enxcol_.default.esc"
72+
ecocCollection: "enxcol_.default.ecoc"
73+
<<: *encrypted_fields
7074
command_name: insert
7175
- command_started_event:
7276
command:
@@ -77,7 +81,11 @@ tests:
7781
encryptionInformation:
7882
type: 1
7983
schema:
80-
default.default: *encrypted_fields
84+
default.default:
85+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
86+
escCollection: "enxcol_.default.esc"
87+
ecocCollection: "enxcol_.default.ecoc"
88+
<<: *encrypted_fields
8189
command_name: insert
8290
- command_started_event:
8391
command:
@@ -94,7 +102,11 @@ tests:
94102
encryptionInformation:
95103
type: 1
96104
schema:
97-
default.default: *encrypted_fields
105+
default.default:
106+
# libmongocrypt applies escCollection and ecocCollection to outgoing command.
107+
escCollection: "enxcol_.default.esc"
108+
ecocCollection: "enxcol_.default.ecoc"
109+
<<: *encrypted_fields
98110
command_name: find
99111
outcome:
100112
collection:

0 commit comments

Comments
 (0)