DRIVERS-2524 fix commandStarted events with encryptionInformation #1405
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
escCollection
andecocCollection
to the outgoingencryptionInformation
incommand_started_event
.ordered: true
toupdate
anddelete
incommand_started_event
.This PR is a follow-up fix to #1396
Background & motivation
db.runCommand({create: "foo", encryptedFields: {fields: []}})
will apply the default values forescCollection
,ecocCollection
. The default values are included in the response tolistCollections
. This results in theescCollection
andecocCollection
being present in the outgoingencryptionInformation
. See example with mongosh.The C driver match logic currently permits all extra unmatched fields in the actual event. Tests were verified locally with a modified version of the C driver to prohibit extra fields. Tests were verified on Evergreen with an unmodified C driver: https://spruce.mongodb.com/version/643f19ade3c33120b01ba291
The YAML extend << was used to add
escCollection
andecocCollection
to theencrypted_fields
reference. This required changing some JSONcommand_started_events
to YAML.Please complete the following before merging:
[ ] Update changelog.Not applicable. Test changes only[ ] Test these changes against all server versions and topologies (including standalone, replica set, sharded clusters, and serverless).Tested against replica set and standalone. C driver currently does not test CSFLE/QE with sharded cluster or serverless