mongodb / specifications

Specifications related to MongoDB
http://specifications.readthedocs.io/en/latest
Other
389 stars 242 forks source link

DRIVERS-2524 fix commandStarted events with encryptionInformation #1405

Closed kevinAlbs closed 1 year ago

kevinAlbs commented 1 year ago

Summary

This PR is a follow-up fix to https://github.com/mongodb/specifications/pull/1396

Background & motivation

db.runCommand({create: "foo", encryptedFields: {fields: []}}) will apply the default values for escCollection, ecocCollection. The default values are included in the response to listCollections. This results in the escCollection and ecocCollection being present in the outgoing encryptionInformation. 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 and ecocCollection to the encrypted_fields reference. This required changing some JSON command_started_events to YAML.

Please complete the following before merging: