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

Remove ClientEncryption.createKey() in favor of createDataKey()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Client Side Encryption
    • None
    • Needed
    • Hide
      • Drivers that have already implemented the new ClientEncryption.createKey() function (as an alias for the existing ClientEncryption.createDataKey() function) must remove the ClientEncryption.createKey() function. Drivers that have not yet implemented the function should not implement it.
      • Sync CSE unified spec tests to 6a015f59.
      Show
      Drivers that have already implemented the new ClientEncryption.createKey() function (as an alias for the existing ClientEncryption.createDataKey() function) must remove the ClientEncryption.createKey() function. Drivers that have not yet implemented the function should not implement it. Sync CSE unified spec tests to 6a015f59 .
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4416 Fixed 1.22.0
      CXX-2535 Done 3.8.0
      CSHARP-4233 Fixed 2.17.0
      GODRIVER-2473 Done 1.10.0
      JAVA-4661 Done
      NODE-4342 Done mongodb-client-encryption-2.2.0
      MOTOR-987 Duplicate
      PYTHON-3317 Duplicate
      PHPC-2127 Works as Designed
      RUBY-3039 Fixed 2.18.0
      RUST-1377 Duplicate
      SWIFT-1591 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-4416 Fixed 1.22.0 CXX-2535 Done 3.8.0 CSHARP-4233 Fixed 2.17.0 GODRIVER-2473 Done 1.10.0 JAVA-4661 Done NODE-4342 Done mongodb-client-encryption-2.2.0 MOTOR-987 Duplicate PYTHON-3317 Duplicate PHPC-2127 Works as Designed RUBY-3039 Fixed 2.18.0 RUST-1377 Duplicate SWIFT-1591 Duplicate

      Summary

      DRIVERS-1951 introduces a duplicate method for creating a data key called ClientEncryption.createKey. The rationale for adding createKey is written in the spec:

      createDataKey existed before createKey, but createKey was added for parity with the mongosh interface. createDataKey remains for backwards compatibility.

      This rationale seems weak at best. It would make more sense for mongosh to add createDataKey to conform with existing driver apis rather than creating a duplicate method in 10+ langauges. Adding createKey will lead to confusing documentation for users.

      kenneth.white@mongodb.com also says there's another reason to prefer createDataKey:

      the specificity of createDataKey() could be highly desirable down the road when there are potentially other types of keys/key functions that are introduced

      Motivation

      Who is the affected end user?

      Devs.

      How does this affect the end user?

      They may be confused at having to choose create_key or create_data_key when there doesn't need to be a choice.

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: