-
Type: Improvement
-
Resolution: Done
-
Priority: Unknown
-
None
-
Component/s: None
-
None
-
Needed
-
Summary
DRIVERS-2017 introduced unified spec tests for the Key Management API added to ClientEncryption in DRIVERS-1951. The unified spec tests for the removeKeyAltName() method, as currently written, expect up to two operations: a findOneAndUpdate() to remove a keyAltName from the keyAltNames field of a matching key document, and a conditional updateOne() to $unset the keyAltNames field if the array would otherwise be empty. This is to satisfy the conditions of the partial filter expression for the unique index on keyAltNames in the key vault collection.
The removeKeyAltName() function can be optimized to use only a single findOneAndUpdate() that still conditionally $unsets the keyAltNames field by using an aggregation pipeline.
Motivation
Who is the affected end user?
Any Drivers that have begun implementing, or have already implemented, the new removeKeyAltName() function.
How does this affect the end user?
Drivers will have to update the unified spec test file(s) and implementation of removeKeyAltName() to satisfy the new expectations.
How likely is it that this problem or use case will occur?
N/A
If the problem does occur, what are the consequences and how severe are they?
N/A
Is this issue urgent?
No. This is an optimization.
Is this ticket required by a downstream team?
No.
Is this ticket only for tests?
No. The updated unified spec test will also require updating existing implementations of removeKeyAltName().
- is related to
-
DRIVERS-2017 Add ClientEncryption entity and Key Management API operations to Unified Test Format
- Closed
- split to
-
CDRIVER-4406 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
CSHARP-4212 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
CXX-2527 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
GODRIVER-2456 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
JAVA-4650 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
MOTOR-978 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
NODE-4312 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
PHPC-2125 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
PYTHON-3305 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
RUBY-3027 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed
-
RUST-1365 Reduce expected removeKeyAltName operations to a single findOneAndUpdate
- Closed