[DRIVERS-2367] Allow RewrapManyDataKeyResult.bulkWriteResult to be optional Created: 23/Jun/22  Updated: 07/Apr/23  Resolved: 07/Apr/23

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

Type: Improvement Priority: Unknown
Reporter: Ezra Chung Assignee: Ezra Chung
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to CDRIVER-4415 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to CSHARP-4228 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to CXX-2534 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to GODRIVER-2470 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to JAVA-4659 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to MOTOR-986 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to NODE-4332 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to PHPC-2126 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to PYTHON-3314 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to RUBY-3034 Allow RewrapManyDataKeyResult.bulkWri... Closed
split to RUST-1376 Allow RewrapManyDataKeyResult.bulkWri... Closed
Related
is related to DRIVERS-1951 Key Management API Closed
is related to DRIVERS-2017 Add ClientEncryption entity and Key M... Closed
Epic Link: Key Management API
Driver Changes: Needed
Quarter: FY23Q2
Downstream Changes Summary:
  • RewrapManyDataKeyResult.bulkWriteResult must be made an optional field that is unset if no bulk write operation is executed by ClientEncryption.rewrapManyDataKey() due to no matching keys.
  • Sync CSE unified test files with 68d1095e.
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4415 Fixed 1.22.0
CXX-2534 Done 3.8.0
CSHARP-4228 Fixed 2.17.0
GODRIVER-2470 Duplicate
JAVA-4659 Done
NODE-4332 Done
MOTOR-986 Duplicate
PYTHON-3314 Duplicate
PHPC-2126 Fixed 1.15.0
RUBY-3034 Fixed 2.18.0
RUST-1376 Duplicate
SWIFT-1590 Duplicate

 Description   

Summary

Change the specification of RewrapManyDataKeyResult.bulkWriteResult from BulkWriteResult to Optional<BulkWriteResult>. Update corresponding unified test files to avoid unnecessarily matching bulkWriteResult against an empty document.

Motivation

Who is the affected end user?

Drivers implementing ClientEncryption.rewrapManyDataKey() and testing against the corresponding unified spec tests.

How does this affect the end user?

The Client Side Encryption spec currently defines the RewrapManyDataKeyResult.bulkWriteResult field as a BulkWriteResult. This is causing some confusion regarding what the value of bulkWriteResult should be provided ClientEncryption.rewrapManyDataKey() does not issue an unnecessary bulk write command due to no matching key documents to rewrap.

How likely is it that this problem or use case will occur?

Users that have already implemented ClientEncryption.rewrapManyDataKey() and RewrapManyDataKeyResult may have to update their implementations to allow for the bulkWriteResult field to be optional.

If the problem does occur, what are the consequences and how severe are they?

If this change is not applied, Drivers may end up with discrepancies in interpretation and implementation of the behavior of rewrapManyDataKey() given the case where there are no matching key documents, thus no well-defined value for bulkWriteResult (an empty document may not be consistent or appropriate across all Drivers).

Is this issue urgent?

No.

Is this ticket required by a downstream team?

No.

Is this ticket only for tests?

No. This may require changes to the implementation of RewrapManyDataKeyResult and corresponding operations that depend on it.



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

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: DRIVERS-2367 Allow RewrapManyDataKeyResult.bulkWriteResult to be optional (#1259)
Branch: master
https://github.com/mongodb/specifications/commit/68d1095ef710ba294894474f7b8f3297c21b86f6

Generated at Thu Feb 08 08:25:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.