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

EncryptOpts queryType should accept a string consistent with queryType in encryptedFields

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Client Side Encryption
    • None
    • Needed
    • Hide

      Bindings Changes

      Upgrade to libmongocrypt 1.5.0-rc2. Binaries can be downloaded from the upload-all task.

      Bindings in the libmongocrypt repository were updated in MONGOCRYPT-414. Drivers with bindings outside of the libmongocrypt repo will need to update bindings code.

      Replace calls of mongocrypt_ctx_setopt_index_type with mongocrypt_ctx_setopt_algorithm.

      Update calls of mongocrypt_ctx_setopt_query_type to use the string "equality".

      Driver Changes

      Change EncryptOpts.QueryType from an enum to a string. See the specification change here: https://github.com/mongodb/specifications/commit/cb58ded938146fcbce2b04a91d09f72d66832603.

      See the C driver changes for reference: https://github.com/mongodb/mongo-c-driver/commit/fe2bae72bc733515d766a46a8799783667396590

      Show
      Bindings Changes Upgrade to libmongocrypt 1.5.0-rc2. Binaries can be downloaded from the upload-all task . Bindings in the libmongocrypt repository were updated in MONGOCRYPT-414. Drivers with bindings outside of the libmongocrypt repo will need to update bindings code. Replace calls of mongocrypt_ctx_setopt_index_type with mongocrypt_ctx_setopt_algorithm . Update calls of mongocrypt_ctx_setopt_query_type to use the string "equality". Driver Changes Change EncryptOpts.QueryType from an enum to a string. See the specification change here: https://github.com/mongodb/specifications/commit/cb58ded938146fcbce2b04a91d09f72d66832603 . See the C driver changes for reference: https://github.com/mongodb/mongo-c-driver/commit/fe2bae72bc733515d766a46a8799783667396590
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4404 Done
      CXX-2525 Backlog
      CSHARP-4204 Duplicate
      GODRIVER-2454 Fixed 1.10.0
      JAVA-4643 Done
      NODE-4303 Done mongodb-client-encryption-2.2.0
      MOTOR-976 Duplicate
      PYTHON-3301 Duplicate
      PHPC-2104 Fixed 1.14.0
      RUBY-3024 Fixed 2.18.0
      RUST-1361 Duplicate
      SWIFT-1581 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-4404 Done CXX-2525 Backlog CSHARP-4204 Duplicate GODRIVER-2454 Fixed 1.10.0 JAVA-4643 Done NODE-4303 Done mongodb-client-encryption-2.2.0 MOTOR-976 Duplicate PYTHON-3301 Duplicate PHPC-2104 Fixed 1.14.0 RUBY-3024 Fixed 2.18.0 RUST-1361 Duplicate SWIFT-1581 Duplicate

      Summary

      EncryptOpts currently defines the queryType option as an enum. Drivers should change the option to accept a string value, which would more easily allow for forward compatibility (a libmongocrypt version bump would likely be required, but drivers would not necessarily need to be changed).

      This would be similar to what is done for Read Concern level, where drivers provide an enum but also accept string values for forward compatibility.

      This would depend on MONGOCRYPT-441, which would change libmongocrypt to accept a string value.

      Ideally, the string value accepted for queryType should be consistent with the queryType option accepted by the server in an encryptedFields document. Then, users could utilize the same constant defined by drivers for use with EncryptOpts.

      Motivation

      Who is the affected end user?

      Users of queryable encryption.

      How does this affect the end user?

      Making the string consistent between encryptedFields and EncryptOpts would be a boon for users.

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

      Users may be confused if encryptedFields and EncryptOpts accept different values for the queryType option.

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

      Immediate error message for an invalid option.

      Is this issue urgent?

      Ideally before 6.0-compat stable driver releases.

      Is this ticket required by a downstream team?

      May be relevant to mongosh.

      Is this ticket only for tests?

      No.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: