Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2367

Allow RewrapManyDataKeyResult.bulkWriteResult to be optional

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Client Side Encryption
    • None
    • Needed
    • Hide
      • 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.
      Show
      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 .
    • $i18n.getText("admin.common.words.hide")
      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
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } 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

      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.

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            ezra.chung@mongodb.com Ezra Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: