[DRIVERS-2356] Reduce expected removeKeyAltName operations to a single findOneAndUpdate Created: 14/Jun/22  Updated: 07/Apr/23  Resolved: 07/Apr/23

Status: Closed
Project: Drivers
Component/s: None
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-4406 Reduce expected removeKeyAltName oper... Closed
split to CSHARP-4212 Reduce expected removeKeyAltName oper... Closed
split to CXX-2527 Reduce expected removeKeyAltName oper... Closed
split to GODRIVER-2456 Reduce expected removeKeyAltName oper... Closed
split to JAVA-4650 Reduce expected removeKeyAltName oper... Closed
split to MOTOR-978 Reduce expected removeKeyAltName oper... Closed
split to NODE-4312 Reduce expected removeKeyAltName oper... Closed
split to PHPC-2125 Reduce expected removeKeyAltName oper... Closed
split to PYTHON-3305 Reduce expected removeKeyAltName oper... Closed
split to RUBY-3027 Reduce expected removeKeyAltName oper... Closed
split to RUST-1365 Reduce expected removeKeyAltName oper... Closed
Related
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:
  • Sync CSE Unified Spec Tests for ClientEncryption.removeKeyAltName() to dade3e4d.
  • If applicable, update implementation of ClientEncryption.removeKeyAltName() to use a single findOneAndUpdate() for both keyAltName removal and conditionally unsetting the keyAltNames field.
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4406 Fixed 1.22.0
CXX-2527 Done 3.8.0
CSHARP-4212 Fixed 2.17.0
GODRIVER-2456 Duplicate
JAVA-4650 Done
NODE-4312 Done
MOTOR-978 Duplicate
PYTHON-3305 Duplicate
PHPC-2125 Fixed 1.15.0
RUBY-3027 Fixed 2.18.0
RUST-1365 Duplicate
SWIFT-1584 Duplicate

 Description   

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().



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

Author:

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

Message: DRIVERS-2356 Reduce expected removeKeyAltName operations to a single findOneAndUpdate (#1250)
Branch: master
https://github.com/mongodb/specifications/commit/dade3e4dd6493e4c5cb8bcb47d6a80e843a7e34f

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