[DRIVERS-2619] fle2v2-CreateCollection tests expect embedded nulls to be treated specially Created: 28/Apr/23  Updated: 21/Aug/23

Status: Implementing
Project: Drivers
Component/s: Client Side Encryption
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Shane Harvey Assignee: Kevin Albertson
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to CXX-2698 fle2v2-CreateCollection tests expect ... Backlog
split to GODRIVER-2864 fle2v2-CreateCollection tests expect ... Backlog
split to JAVA-5016 fle2v2-CreateCollection tests expect ... Backlog
split to RUST-1671 fle2v2-CreateCollection tests expect ... Backlog
split to CDRIVER-4657 fle2v2-CreateCollection tests expect ... Closed
split to CSHARP-4664 fle2v2-CreateCollection tests expect ... Closed
split to MOTOR-1138 fle2v2-CreateCollection tests expect ... Closed
split to NODE-5327 fle2v2-CreateCollection tests expect ... Closed
split to PHPLIB-1157 fle2v2-CreateCollection tests expect ... Closed
split to PYTHON-3724 fle2v2-CreateCollection tests expect ... Closed
split to RUBY-3270 fle2v2-CreateCollection tests expect ... Closed
Related
related to PYTHON-3614 Update libmongocrypt payloads to new ... Closed
related to DRIVERS-2524 Drivers should not create the ECC col... Closed
Driver Changes: Needed
Downstream Changes Summary:

This includes a fix to the fle2v2-CreateCollection test assertions. Update the fle2v2-CreateCollection test to this commit: mongodb/specifications@e59a0ac.

If the test previously passed, this may suggest a bug in the test runner of the Client Side Encryption legacy format. The matching behavior of `command_started_event` is expected to reject extra captured fields in the subdocuments of `command`.

This suggests test runners are expected not to allow extra fields in subdocuments of the command. Test runners are not expected to handle null values specially for subdocuments of the command.

Engineering Lead: Kevin Albertson Kevin Albertson
Start date:
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4657 Fixed 1.24.0
CXX-2698 Backlog
CSHARP-4664 Done 2.20.0
GODRIVER-2864 Backlog
JAVA-5016 Backlog
NODE-5327 Done 5.7.0
MOTOR-1138 Duplicate
PYTHON-3724 Fixed 4.4
PHPLIB-1157 Fixed 1.16.0
RUBY-3270 Fixed 2.19.0
RUST-1671 Backlog

 Description   

DRIVERS-2524 added a legacy format QE test with embedded null fields in a command_started_event:

        - command_started_event:
            command:
              create: *encrypted_collection_name
              encryptedFields: &encrypted_fields_expectation {
                # Expect state collections are not included in the encryptedFields sent to the server.
                "escCollection": null,
                "ecocCollection": null,
                "eccCollection": null,

https://github.com/mongodb/specifications/blob/aa28f78/source/client-side-encryption/tests/legacy/fle2v2-CreateCollection.yml#L99-L107

AFAIK only top-level nulls are intended to be treated specially and embedded documents are supposed to be compared with exact match semantics. When implementing this test in PYTHON-3614 I had to add a workaround in pymongo's legacy test runner like this:

                            # Workaround an incorrect command started event in fle2v2-CreateCollection.yml
                            # added in DRIVERS-2524.
                            if key == "encryptedFields":
                                for n in ("eccCollection", "ecocCollection", "escCollection"):
                                    if val.get(n) is None:
                                        val.pop(n, None)

Is this workaround is required or can we simply remove the escCollection/etc.. fields from the test?



 Comments   
Comment by Githook User [ 06/Jun/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: DRIVERS-2619 Remove null values from `command_started_event` in fle2v2-CreateCollection.yml (#1429)

  • remove null values from `command_started_event`
  • link to legacy command monitoring spec tests runner
Generated at Thu Feb 08 08:26:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.