micronaut-mongodb icon indicating copy to clipboard operation
micronaut-mongodb copied to clipboard

Enable Micronaut + MongoDB AutoEncryption (CSFLE)

Open JGaya3 opened this issue 1 year ago • 3 comments

Issue description

Hi Team,

We are working on a micronaut project and trying to enable client-side field level encryption via mongodb. As per the Mongo Documentation, added the required settings in a customized Factory class called MongoConfig.java. But autoEncryption settings are not getting set in the MongoClient.

The main objective is to enable encryption, without writing our own customized encryption logic. As mongo provides CSFLE autoencryption, we are trying to utilize it.

mongo_autoencryption

mongo_autoencryption_log

JGaya3 avatar Jul 27 '23 08:07 JGaya3

@JGaya3 Looking at the log you provided, looks like uuidRepresentation is not applied either from your settings. You specified .uuidRepresentation(STANDARD) but logged settings show UNSPECIFIED. Perhaps your factory is not working correctly and these settings are not being applied at all?

radovanradic avatar Sep 14 '23 11:09 radovanradic

Hi @radovanradic , Yes seems like the factory class is not working as expected.

JGaya3 avatar Sep 18 '23 17:09 JGaya3

@JGaya3 Were you able to configure factory to work the way you want? There is some documentation about Factory Replacement here and an example here that could help you resolve it

radovanradic avatar Sep 27 '23 13:09 radovanradic