[JAVA-3344] There are 2 bugs in the client side encryption doc Created: 27/Jun/19  Updated: 28/Oct/23  Resolved: 01/Jul/19

Status: Closed
Project: Java Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: 3.11.0

Type: Bug Priority: Major - P3
Reporter: Sepp Renfer Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mac os


Epic Link: Client-side FLE

 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



 Comments   
Comment by Githook User [ 01/Jul/19 ]

Author:

{'name': 'Ross Lawley', 'username': 'rozza', 'email': 'ross.lawley@gmail.com'}

Message: Fix client side encryption example code

JAVA-3344
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/2a3fea5d8e375effadd09f4f1e07ed617eb57b4b

Comment by Ross Lawley [ 28/Jun/19 ]

PR: https://github.com/rozza/mongo-java-driver/pull/326

Comment by Ross Lawley [ 28/Jun/19 ]

Thanks sepp.renfer - there was a last minute name change and looks like some items were missed.

We'll get it updated and add the code to the examples directory - so its checked by the compiler and runnable.

Comment by Sepp Renfer [ 27/Jun/19 ]

how can I move it

Comment by Sepp Renfer [ 27/Jun/19 ]

sorry wrong driver, this should be under java driver

Generated at Thu Feb 08 08:59:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.