[MONGOCRYPT-450] Remove unnecessary fields from rewrapManyDataKey result Created: 28/Jun/22  Updated: 28/Oct/23  Resolved: 28/Jun/22

Status: Closed
Project: Libmongocrypt
Component/s: Field Level Encryption
Affects Version/s: None
Fix Version/s: 1.5.0, 1.6.0, 1.6.0-alpha0

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

Issue Links:
Related
is related to MONGOCRYPT-365 Support new context and state for rew... Closed
is related to NODE-4356 Update implementation of rewrapManyDa... Closed
Binding Changes: Not Needed

 Description   

Summary

libmongocrypt is arbitrarily (and misleadingly) making an effort to return all fields of the key document(s) being rewrapped by rewrapManyDataKey. Only _id, keyMaterial, and masterKey are required to construct the bulk write operations to update rewrapped key documents in the key vault collection.

Motivation

Who is the affected end user?

Drivers implementing rewrapManyDataKey.

How does this affect the end user?

Avoids unnecessarily consuming memory for unused fields in the resulting documents.

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

Unlikely; Drivers should not be using any of the extra fields in the key document(s). This is also asserted by the CSE unified spec tests.

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

Not severe. Returning a "full" key document gives the mistaken impression that a replaceOne operation may be appropriate to update the given key document in the key vault collection.

Is this issue urgent?

No.

Is this ticket required by a downstream team?

No.

Is this ticket only for tests?

No. It has functional impact, but the impact should be minimal/none.



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

Author:

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

Message: MONGOCRYPT-450 Update documentation of mongocrypt_ctx_finalize (#385)
Branch: master
https://github.com/mongodb/libmongocrypt/commit/8b63e9e36db2846a0fecb2ae3a6e54b0535f8546

Comment by Githook User [ 28/Jun/22 ]

Author:

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

Message: MONGOCRYPT-450 Remove unnecessary fields from rewrapManyDataKey result (#382)
Branch: master
https://github.com/mongodb/libmongocrypt/commit/edb12c6b54602f68abeb376907579983da75ee18

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