chibenwa commented on code in PR #2495:
URL: https://github.com/apache/james-project/pull/2495#discussion_r1858557210


##########
server/container/guice/distributed/src/main/java/org/apache/james/modules/blobstore/BlobStoreModulesChooser.java:
##########
@@ -72,10 +80,33 @@ protected void configure() {
             install(new S3BlobStoreModule());
             install(new S3BucketModule());
 
-            
bind(BlobStoreDAO.class).annotatedWith(Names.named(UNENCRYPTED)).to(S3BlobStoreDAO.class)
-                .in(Scopes.SINGLETON);
             Multibinder.newSetBinder(binder(), 
HealthCheck.class).addBinding().to(ObjectStorageHealthCheck.class);
         }
+
+        @Provides
+        @Singleton
+        @Named(UNENCRYPTED)
+        BlobStoreDAO blobStoreDAO(S3ClientFactory s3ClientFactory,
+                                  S3BlobStoreConfiguration configuration,
+                                  BlobId.Factory blobIdFactory) throws 
InvalidKeySpecException, NoSuchAlgorithmException {
+            if (!configuration.ssecEnabled()) {
+                return new S3BlobStoreDAO(s3ClientFactory, configuration, 
blobIdFactory);
+            }
+
+            S3SSECustomerKeyFactory sseCustomerKeyFactory = 
getS3SSECustomerKeyFactory(configuration);
+            S3RequestOption s3RequestOption = new S3RequestOption(new 
S3RequestOption.SSEC(true, Optional.of(sseCustomerKeyFactory)));
+            return new S3BlobStoreDAO(s3ClientFactory, configuration, 
blobIdFactory, s3RequestOption);
+        }

Review Comment:
   IMO we do not need a module chooser.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to