Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3344

There are 2 bugs in the client side encryption doc

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.11.0
    • None
    • Documentation
    • None
    • mac os

    Description

      There are 2 bugs in the client side encryption doc (java driver). The second example does not compile.

      it should be

      var dataKeyId = clientEncryption.createDataKey("local", new DataKeyOptions());
      

      instead of

      var dataKeyId = keyVault.createDataKey("local", new DataKeyOptions());
      

      and

      var autoEncryptionSettings = AutoEncryptionSettings.builder()
       .keyVaultNamespace(keyVaultNamespace)
       .kmsProviders(kmsProviders)
       .schemaMap(Map.of....
      

      instead of

      var autoEncryptionSettings = AutoEncryptionSettings.builder()
       .keyVaultNamespace(keyVaultNamespace)
       .kmsProviders(kmsProviders)
       .namespaceToLocalSchemaDocumentMap(Map.of
      

      I am talking about this page: https://mongodb.github.io/mongo-java-driver/3.11/driver/tutorials/client-side-encryption/

      Also it is only working in java >= Java 10

      We should add a comment that you need java 10 or provide a java 8 example

      I am seeing lot’s of developers struggling with our examples because they are not as skilled as you might expect them to be

      here is my example that works in Java 10

      https://github.com/codedearta/mongodb-example-clientside-encryption

      Attachments

        Activity

          People

            ross@mongodb.com Ross Lawley
            sepp.renfer@mongodb.com Sepp Renfer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: