-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Client Side Encryption
-
None
-
Minor Change
-
Not Needed
-
Users are not required to specify the key vault client settings via ClientEncryptionSettings. Moreover, the documentation of ClientEncryptionSettings.getKeyVaultMongoClientSettings says "May be null to indicate that the same MongoClient should be used to access the key vault collection as is used for the rest of the application". In practice, we have this:
java.lang.IllegalArgumentException: settings can not be null at com.mongodb.assertions.Assertions.notNull(Assertions.java:48) at com.mongodb.client.internal.MongoClientImpl.createCluster(MongoClientImpl.java:227) at com.mongodb.client.internal.MongoClientImpl.<init>(MongoClientImpl.java:72) at com.mongodb.client.MongoClients.create(MongoClients.java:108) at com.mongodb.client.MongoClients.create(MongoClients.java:50) at com.mongodb.client.internal.ClientEncryptionImpl.<init>(ClientEncryptionImpl.java:69) at com.mongodb.client.vault.ClientEncryptions.create(ClientEncryptions.java:37)
When this ticket is done, we should do the changes necessary to get rid of the following SpotBugs exclusions in mongo-java-driver/config/spotbugs/exclude.xml
<Match> <Class name="com.mongodb.client.internal.ClientEncryptionImpl"/> <Method name="createEncryptedCollection"/> <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/> </Match> <Match> <Class name="com.mongodb.reactivestreams.client.internal.vault.ClientEncryptionImpl"/> <Method name="~.*createEncryptedCollection.*"/> <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/> </Match>