oscerd commented on code in PR #28553:
URL: https://github.com/apache/camel/pull/28553#discussion_r4387000784


##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioProducer.java:
##########
@@ -196,6 +196,17 @@ private void doPutObject(
                 .object(objectName)
                 .userMetadata(objectMetadata);
 
+        if (getConfiguration().getServerSideEncryption() != null
+                && getConfiguration().getServerSideEncryptionCustomerKey() != 
null) {
+            throw new IllegalArgumentException(
+                    "Only one of serverSideEncryption or 
serverSideEncryptionCustomerKey may be configured, not both");
+        }

Review Comment:
   Addressed: mutual exclusion is now validated once during producer startup 
(`doStart()`), failing fast and eliminating the duplicate check from 
`doPutObject` and `copyObject`.
   
   _Claude Code on behalf of oscerd_



##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioProducer.java:
##########
@@ -256,11 +272,26 @@ private void copyObject(MinioClient minioClient, Exchange 
exchange) throws Excep
                     .bucket(bucketName)
                     .object(sourceKey);
 
+            if (getConfiguration().getServerSideEncryptionCustomerKey() != 
null) {
+                
copySourceBuilder.ssec(getConfiguration().getServerSideEncryptionCustomerKey());
+            }
+
             CopyObjectArgs.Builder copyObjectRequest = CopyObjectArgs.builder()
                     .bucket(destinationBucketName)
                     .object(destinationKey)
                     .source(copySourceBuilder.build());
 
+            if (getConfiguration().getServerSideEncryption() != null
+                    && getConfiguration().getServerSideEncryptionCustomerKey() 
!= null) {
+                throw new IllegalArgumentException(
+                        "Only one of serverSideEncryption or 
serverSideEncryptionCustomerKey may be configured, not both");
+            }

Review Comment:
   Addressed: by moving the mutual exclusion validation into `doStart()`, this 
check runs once during lifecycle initialization before any exchange processing 
or builder invocation.
   
   _Claude Code on behalf of oscerd_



##########
components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioProducer.java:
##########
@@ -256,11 +272,26 @@ private void copyObject(MinioClient minioClient, Exchange 
exchange) throws Excep
                     .bucket(bucketName)
                     .object(sourceKey);
 
+            if (getConfiguration().getServerSideEncryptionCustomerKey() != 
null) {
+                
copySourceBuilder.ssec(getConfiguration().getServerSideEncryptionCustomerKey());
+            }
+
             CopyObjectArgs.Builder copyObjectRequest = CopyObjectArgs.builder()
                     .bucket(destinationBucketName)
                     .object(destinationKey)
                     .source(copySourceBuilder.build());
 
+            if (getConfiguration().getServerSideEncryption() != null
+                    && getConfiguration().getServerSideEncryptionCustomerKey() 
!= null) {
+                throw new IllegalArgumentException(
+                        "Only one of serverSideEncryption or 
serverSideEncryptionCustomerKey may be configured, not both");

Review Comment:
   Addressed: `serverSideEncryption` and `serverSideEncryptionCustomerKey` are 
endpoint-level options on `MinioConfiguration`, so the producer validates at 
startup (`doStart()`) that only one is configured. We can consider supporting 
independent source/destination encryption options in a separate enhancement 
issue.
   
   _Claude Code on behalf of oscerd_



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to