You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/04/17 13:43:54 UTC

[camel] 05/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, lets do the same for upload

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 41cf29f82d9f043adc26ae0bcc4b51a0beb11d81
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 14:53:40 2020 +0200

    CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, lets do the same for upload
---
 .../org/apache/camel/component/aws2/s3/AWS2S3Producer.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Producer.java b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Producer.java
index 00f29cf..019e09d 100644
--- a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Producer.java
+++ b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Producer.java
@@ -285,6 +285,18 @@ public class AWS2S3Producer extends DefaultProducer {
                 putObjectRequest.ssekmsKeyId(getConfiguration().getAwsKMSKeyId());
             }
         }
+        
+        if (getConfiguration().isUseCustomerKey()) {
+            if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyId())) {
+                putObjectRequest.sseCustomerKey(getConfiguration().getCustomerKeyId());
+            }
+            if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyMD5())) {
+                putObjectRequest.sseCustomerKeyMD5(getConfiguration().getCustomerKeyMD5());
+            }
+            if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerAlgorithm())) {
+                putObjectRequest.sseCustomerAlgorithm(getConfiguration().getCustomerAlgorithm());
+            }
+        }        
 
         LOG.trace("Put object [{}] from exchange [{}]...", putObjectRequest, exchange);