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

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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Unknown
    • Resolution: Done
    • None
    • 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 .

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: