Arsnael commented on code in PR #2488:
URL: https://github.com/apache/james-project/pull/2488#discussion_r1839338331


##########
server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/sse/S3SSECConfiguration.java:
##########
@@ -23,20 +23,23 @@
 
 import com.google.common.base.Preconditions;
 
-public record S3SSECustomerConfiguration(boolean enabled,
-                                         String algorithm,
-                                         String masterPassword,
-                                         String salt) {
+public interface S3SSECConfiguration {
 
-    public static final List<String> SUPPORTED_ALGORITHMS = List.of("AES256");
+    List<String> SUPPORTED_ALGORITHMS = List.of("AES256");
 
-    public S3SSECustomerConfiguration(boolean enabled, String algorithm, 
String masterPassword, String salt) {
-        this.enabled = enabled;
-        if (enabled) {
-            
Preconditions.checkArgument(SUPPORTED_ALGORITHMS.contains(algorithm), 
"Unsupported algorithm: %s. The supported algorithms are: %s", algorithm, 
SUPPORTED_ALGORITHMS);
+    String algorithm();
+
+    record Basic(String algorithm,
+                 String masterPassword,
+                 String salt) implements S3SSECConfiguration {
+        public Basic {
+            
Preconditions.checkArgument(SUPPORTED_ALGORITHMS.contains(algorithm), 
"Unsupported algorithm: " + algorithm + ". The supported algorithms are: " + 
SUPPORTED_ALGORITHMS);
+        }
+    }
+
+    record KeyDerivationEnabled(String algorithm) implements 
S3SSECConfiguration {

Review Comment:
   No answer to that remark?



-- 
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