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:49 UTC
[camel] branch master updated (2152e19 -> fab6a38)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 2152e19 Regen website docs
new 7222d90 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption
new 88f3ee4 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, added an integration test
new 51ed5af CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, disabling integration test
new fe6b1e9 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, lets do the same for multipart upload
new 41cf29f CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, lets do the same for upload
new 99e1d17 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, fixed CS
new 377991f CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, fixed tests naming
new 512f414 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, regen website docs
new 0c35d9f CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, added example in docs
new fab6a38 CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, regen docs
The 10 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../aws2/s3/AWS2S3ComponentConfigurer.java | 20 ++++++
.../aws2/s3/AWS2S3EndpointConfigurer.java | 20 ++++++
.../apache/camel/component/aws2/s3/aws2-s3.json | 8 +++
.../src/main/docs/aws2-s3-component.adoc | 31 ++++++++-
.../component/aws2/s3/AWS2S3Configuration.java | 54 +++++++++++++++
.../camel/component/aws2/s3/AWS2S3Producer.java | 41 ++++++++++-
...ObjectCustomerKeyOperationIntegrationTest.java} | 81 ++++++++++++++++++++--
.../dsl/Aws2S3ComponentBuilderFactory.java | 52 ++++++++++++++
.../endpoint/dsl/AWS2S3EndpointBuilderFactory.java | 62 +++++++++++++++++
.../modules/ROOT/pages/aws2-s3-component.adoc | 31 ++++++++-
10 files changed, 388 insertions(+), 12 deletions(-)
copy components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/{S3CopyObjectOperationIntegrationTest.java => S3CopyObjectCustomerKeyOperationIntegrationTest.java} (50%)
[camel] 10/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, regen docs
Posted by ac...@apache.org.
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 fab6a382cf6022140dc30a8018f53486289dfe94
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 15:41:04 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, regen docs
---
.../modules/ROOT/pages/aws2-s3-component.adoc | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/docs/components/modules/ROOT/pages/aws2-s3-component.adoc b/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
index 593af7f..285d1df 100644
--- a/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
@@ -528,6 +528,25 @@ This will require specifying the destinationBucket option. As example:
In this case the objects consumed will be moved to myothercamelbucket bucket and deleted from the original one (because of deleteAfterRead set to true as default).
+== Using customer key as encryption
+
+We introduced also the customer key support (an alternative of using KMS). The following code shows an example.
+
+[source,java]
+--------------------------------------------------------------------------------
+String key = UUID.randomUUID().toString();
+byte[] secretKey = generateSecretKey();
+String b64Key = Base64.getEncoder().encodeToString(secretKey);
+String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
+
+String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
+
+from("direct:putObject")
+ .setHeader(AWS2S3Constants.KEY, constant("test.txt"))
+ .setBody(constant("Test"))
+ .to(awsEndpoint);
+--------------------------------------------------------------------------------
+
== Dependencies
Maven users will need to add the following dependency to their pom.xml.
[camel] 08/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, regen website docs
Posted by ac...@apache.org.
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 512f414d0d4617ddd24ee3eb840c63d455d89cc5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 15:15:40 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, regen website docs
---
docs/components/modules/ROOT/pages/aws2-s3-component.adoc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/docs/components/modules/ROOT/pages/aws2-s3-component.adoc b/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
index bb73aec..593af7f 100644
--- a/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-s3-component.adoc
@@ -49,7 +49,7 @@ from("aws2-s3://helloBucket?accessKey=yourAccessKey&secretKey=yourSecretKey&pref
// component options: START
-The AWS2 S3 Storage Service component supports 34 options, which are listed below.
+The AWS2 S3 Storage Service component supports 38 options, which are listed below.
@@ -86,7 +86,11 @@ The AWS2 S3 Storage Service component supports 34 options, which are listed belo
| *partSize* (producer) | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | long
| *storageClass* (producer) | The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request. | | String
| *awsKMSKeyId* (producer) | Define the id of KMS key to use in case KMS is enabled | | String
+| *customerAlgorithm* (producer) | Define the customer algorithm to use in case CustomerKey is enabled | | String
+| *customerKeyId* (producer) | Define the id of Customer key to use in case CustomerKey is enabled | | String
+| *customerKeyMD5* (producer) | Define the MD5 of Customer key to use in case CustomerKey is enabled | | String
| *useAwsKMS* (producer) | Define if KMS must be used or not | false | boolean
+| *useCustomerKey* (producer) | Define if Customer Key must be used or not | false | boolean
| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *accessKey* (security) | Amazon AWS Access Key | | String
| *secretKey* (security) | Amazon AWS Secret Key | | String
@@ -122,7 +126,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (54 parameters):
+=== Query Parameters (58 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -163,7 +167,11 @@ with the following path and query parameters:
| *partSize* (producer) | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | long
| *storageClass* (producer) | The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request. | | String
| *awsKMSKeyId* (producer) | Define the id of KMS key to use in case KMS is enabled | | String
+| *customerAlgorithm* (producer) | Define the customer algorithm to use in case CustomerKey is enabled | | String
+| *customerKeyId* (producer) | Define the id of Customer key to use in case CustomerKey is enabled | | String
+| *customerKeyMD5* (producer) | Define the MD5 of Customer key to use in case CustomerKey is enabled | | String
| *useAwsKMS* (producer) | Define if KMS must be used or not | false | boolean
+| *useCustomerKey* (producer) | Define if Customer Key must be used or not | false | boolean
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
| *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. | | int
[camel] 04/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, lets do the same for multipart upload
Posted by ac...@apache.org.
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 fe6b1e97abbb5b32c02148022056522f0a342cbb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 14:52:09 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, lets do the same for multipart 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 8f90076..00f29cf 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
@@ -166,6 +166,18 @@ public class AWS2S3Producer extends DefaultProducer {
if (getConfiguration().isUseAwsKMS()) {
createMultipartUploadRequest.ssekmsKeyId(getConfiguration().getAwsKMSKeyId());
}
+
+ if (getConfiguration().isUseCustomerKey()) {
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyId())) {
+ createMultipartUploadRequest.sseCustomerKey(getConfiguration().getCustomerKeyId());
+ }
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyMD5())) {
+ createMultipartUploadRequest.sseCustomerKeyMD5(getConfiguration().getCustomerKeyMD5());
+ }
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerAlgorithm())) {
+ createMultipartUploadRequest.sseCustomerAlgorithm(getConfiguration().getCustomerAlgorithm());
+ }
+ }
LOG.trace("Initiating multipart upload [{}] from exchange [{}]...", createMultipartUploadRequest, exchange);
[camel] 07/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, fixed tests naming
Posted by ac...@apache.org.
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 377991f6ae5de58e4033f032562748abf07d93e6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 15:01:02 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, fixed tests naming
---
...yObjectCustomerKeyOperationIntegrationTest.java | 77 +++++++++++++++++++++-
.../S3CopyObjectOperationIntegrationTest.java | 77 +---------------------
2 files changed, 77 insertions(+), 77 deletions(-)
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
index 3726c27..fa723a9 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
@@ -16,6 +16,18 @@
*/
package org.apache.camel.component.aws2.s3.integration;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
+import java.util.Base64;
+import java.util.UUID;
+
+import javax.crypto.KeyGenerator;
+
import org.apache.camel.BindToRegistry;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
@@ -30,11 +42,24 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.core.ResponseInputStream;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
+import software.amazon.awssdk.services.s3.model.GetObjectRequest;
+import software.amazon.awssdk.services.s3.model.GetObjectResponse;
+import software.amazon.awssdk.utils.Md5Utils;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AES256;
@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3CopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSupport {
+
+ String key = UUID.randomUUID().toString();
+ byte[] secretKey = generateSecretKey();
+ String b64Key = Base64.getEncoder().encodeToString(secretKey);
+ String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
@BindToRegistry("amazonS3Client")
S3Client client = S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("xxx", "yyy"))).region(Region.EU_WEST_1).build();
@@ -68,6 +93,27 @@ public class S3CopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSu
exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.copyObject);
}
});
+
+ Exchange res = template.request("direct:getObject", new Processor() {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ GetObjectRequest getObjectRequest = GetObjectRequest.builder()
+ .key("test1.txt")
+ .bucket("mycamel1")
+ .sseCustomerKey(b64Key)
+ .sseCustomerAlgorithm(AES256.name())
+ .sseCustomerKeyMD5(b64KeyMd5)
+ .build();
+ exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.getObject);
+ exchange.getIn().setBody(getObjectRequest);
+ }
+ });
+
+ ResponseInputStream<GetObjectResponse> s3 = res.getIn().getBody(ResponseInputStream.class);
+
+
+ assertEquals("Test", readInputStream(s3));
assertMockEndpointsSatisfied();
}
@@ -77,13 +123,38 @@ public class S3CopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSu
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false";
-
+ String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
+ String awsEndpoint1 = "aws2-s3://mycamel1?autoCreateBucket=false&pojoRequest=true";
from("direct:putObject").to(awsEndpoint);
- from("direct:copyObject").to(awsEndpoint).to("mock:result");
+ from("direct:copyObject").to(awsEndpoint);
+
+ from("direct:getObject").to(awsEndpoint1).to("mock:result");
}
};
}
+
+ protected static byte[] generateSecretKey() {
+ KeyGenerator generator;
+ try {
+ generator = KeyGenerator.getInstance("AES");
+ generator.init(256, new SecureRandom());
+ return generator.generateKey().getEncoded();
+ } catch (Exception e) {
+ fail("Unable to generate symmetric key: " + e.getMessage());
+ return null;
+ }
+ }
+
+ private String readInputStream(ResponseInputStream<GetObjectResponse> s3Object) throws IOException {
+ StringBuilder textBuilder = new StringBuilder();
+ try (Reader reader = new BufferedReader(new InputStreamReader(s3Object, Charset.forName(StandardCharsets.UTF_8.name())))) {
+ int c = 0;
+ while ((c = reader.read()) != -1) {
+ textBuilder.append((char)c);
+ }
+ }
+ return textBuilder.toString();
+ }
}
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
index fb0c6dd..b02c867 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
@@ -16,18 +16,6 @@
*/
package org.apache.camel.component.aws2.s3.integration;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.security.SecureRandom;
-import java.util.Base64;
-import java.util.UUID;
-
-import javax.crypto.KeyGenerator;
-
import org.apache.camel.BindToRegistry;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
@@ -42,24 +30,11 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
-import software.amazon.awssdk.core.ResponseInputStream;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
-import software.amazon.awssdk.services.s3.model.GetObjectRequest;
-import software.amazon.awssdk.services.s3.model.GetObjectResponse;
-import software.amazon.awssdk.utils.Md5Utils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
-import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AES256;
@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
-
- String key = UUID.randomUUID().toString();
- byte[] secretKey = generateSecretKey();
- String b64Key = Base64.getEncoder().encodeToString(secretKey);
- String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
@BindToRegistry("amazonS3Client")
S3Client client = S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("xxx", "yyy"))).region(Region.EU_WEST_1).build();
@@ -93,27 +68,6 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.copyObject);
}
});
-
- Exchange res = template.request("direct:getObject", new Processor() {
-
- @Override
- public void process(Exchange exchange) throws Exception {
- GetObjectRequest getObjectRequest = GetObjectRequest.builder()
- .key("test1.txt")
- .bucket("mycamel1")
- .sseCustomerKey(b64Key)
- .sseCustomerAlgorithm(AES256.name())
- .sseCustomerKeyMD5(b64KeyMd5)
- .build();
- exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.getObject);
- exchange.getIn().setBody(getObjectRequest);
- }
- });
-
- ResponseInputStream<GetObjectResponse> s3 = res.getIn().getBody(ResponseInputStream.class);
-
-
- assertEquals("Test", readInputStream(s3));
assertMockEndpointsSatisfied();
}
@@ -123,38 +77,13 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
- String awsEndpoint1 = "aws2-s3://mycamel1?autoCreateBucket=false&pojoRequest=true";
+ String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false";
+
from("direct:putObject").to(awsEndpoint);
- from("direct:copyObject").to(awsEndpoint);
-
- from("direct:getObject").to(awsEndpoint1).to("mock:result");
+ from("direct:copyObject").to(awsEndpoint).to("mock:result");
}
};
}
-
- protected static byte[] generateSecretKey() {
- KeyGenerator generator;
- try {
- generator = KeyGenerator.getInstance("AES");
- generator.init(256, new SecureRandom());
- return generator.generateKey().getEncoded();
- } catch (Exception e) {
- fail("Unable to generate symmetric key: " + e.getMessage());
- return null;
- }
- }
-
- private String readInputStream(ResponseInputStream<GetObjectResponse> s3Object) throws IOException {
- StringBuilder textBuilder = new StringBuilder();
- try (Reader reader = new BufferedReader(new InputStreamReader(s3Object, Charset.forName(StandardCharsets.UTF_8.name())))) {
- int c = 0;
- while ((c = reader.read()) != -1) {
- textBuilder.append((char)c);
- }
- }
- return textBuilder.toString();
- }
}
[camel] 01/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption
Posted by ac...@apache.org.
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 7222d908e0415a6d89f5460c45370e303f82fb4a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 13:35:27 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption
---
.../component/aws2/s3/AWS2S3Configuration.java | 54 ++++++++++++++++++++++
.../camel/component/aws2/s3/AWS2S3Producer.java | 12 +++++
2 files changed, 66 insertions(+)
diff --git a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
index 18d1665..b714e8e 100644
--- a/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
+++ b/components/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3Configuration.java
@@ -77,6 +77,14 @@ public class AWS2S3Configuration implements Cloneable {
private boolean useAwsKMS;
@UriParam(label = "producer,advanced")
private String awsKMSKeyId;
+ @UriParam(label = "producer,advanced", defaultValue = "false")
+ private boolean useCustomerKey;
+ @UriParam(label = "producer,advanced")
+ private String customerKeyId;
+ @UriParam(label = "producer,advanced")
+ private String customerKeyMD5;
+ @UriParam(label = "producer,advanced")
+ private String customerAlgorithm;
@UriParam(defaultValue = "false")
private boolean useIAMCredentials;
@UriParam(label = "producer")
@@ -398,6 +406,52 @@ public class AWS2S3Configuration implements Cloneable {
this.awsKMSKeyId = awsKMSKeyId;
}
+ public boolean isUseCustomerKey() {
+ return useCustomerKey;
+ }
+
+ /**
+ * Define if Customer Key must be used or not
+ */
+ public void setUseCustomerKey(boolean useCustomerKey) {
+ this.useCustomerKey = useCustomerKey;
+ }
+
+ public String getCustomerKeyId() {
+ return customerKeyId;
+ }
+
+ /**
+ * Define the id of Customer key to use in case CustomerKey is enabled
+ */
+ public void setCustomerKeyId(String customerKeyId) {
+ this.customerKeyId = customerKeyId;
+ }
+
+
+
+ public String getCustomerKeyMD5() {
+ return customerKeyMD5;
+ }
+
+ /**
+ * Define the MD5 of Customer key to use in case CustomerKey is enabled
+ */
+ public void setCustomerKeyMD5(String customerKeyMD5) {
+ this.customerKeyMD5 = customerKeyMD5;
+ }
+
+ public String getCustomerAlgorithm() {
+ return customerAlgorithm;
+ }
+
+ /**
+ * Define the customer algorithm to use in case CustomerKey is enabled
+ */
+ public void setCustomerAlgorithm(String customerAlgorithm) {
+ this.customerAlgorithm = customerAlgorithm;
+ }
+
/**
* Set whether the S3 client should expect to load credentials on an EC2
* instance or to expect static credentials to be passed in.
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 e5f35a1..18d9722 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
@@ -321,6 +321,18 @@ public class AWS2S3Producer extends DefaultProducer {
copyObjectRequest.ssekmsKeyId(getConfiguration().getAwsKMSKeyId());
}
}
+
+ if (getConfiguration().isUseCustomerKey()) {
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyId())) {
+ copyObjectRequest.sseCustomerKey(getConfiguration().getCustomerKeyId());
+ }
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerKeyMD5())) {
+ copyObjectRequest.sseCustomerKeyMD5(getConfiguration().getCustomerKeyMD5());
+ }
+ if (ObjectHelper.isNotEmpty(getConfiguration().getCustomerAlgorithm())) {
+ copyObjectRequest.sseCustomerAlgorithm(getConfiguration().getCustomerAlgorithm());
+ }
+ }
CopyObjectResponse copyObjectResult = s3Client.copyObject(copyObjectRequest.build());
[camel] 03/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, disabling integration test
Posted by ac...@apache.org.
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 51ed5aff65b3a52226813310c11db96848f331f4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 14:50:03 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, disabling integration test
---
.../aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
index 07c1843..353374c 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
@@ -41,6 +41,7 @@ import org.apache.camel.component.aws2.s3.AWS2S3Constants;
import org.apache.camel.component.aws2.s3.AWS2S3Operations;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
@@ -53,7 +54,7 @@ import software.amazon.awssdk.utils.Md5Utils;
import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AES256;
-//@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
+@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
@BindToRegistry("amazonS3Client")
[camel] 05/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, lets do the same for upload
Posted by ac...@apache.org.
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);
[camel] 06/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, fixed CS
Posted by ac...@apache.org.
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 99e1d1735ff4a590e0acfac20263385a2672aa99
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 14:57:37 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, fixed CS
---
.../S3CopyObjectOperationIntegrationTest.java | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
index 353374c..fb0c6dd 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
@@ -16,9 +16,6 @@
*/
package org.apache.camel.component.aws2.s3.integration;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
-
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -52,10 +49,17 @@ import software.amazon.awssdk.services.s3.model.GetObjectRequest;
import software.amazon.awssdk.services.s3.model.GetObjectResponse;
import software.amazon.awssdk.utils.Md5Utils;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AES256;
@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
+
+ String key = UUID.randomUUID().toString();
+ byte[] secretKey = generateSecretKey();
+ String b64Key = Base64.getEncoder().encodeToString(secretKey);
+ String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
@BindToRegistry("amazonS3Client")
S3Client client = S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("xxx", "yyy"))).region(Region.EU_WEST_1).build();
@@ -65,11 +69,6 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
-
- String key = UUID.randomUUID().toString();
- byte[] secretKey = generateSecretKey();
- String b64Key = Base64.getEncoder().encodeToString(secretKey);
- String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
@Test
public void sendIn() throws Exception {
@@ -114,7 +113,7 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
ResponseInputStream<GetObjectResponse> s3 = res.getIn().getBody(ResponseInputStream.class);
- assertEquals("Test", (readInputStream(s3)));
+ assertEquals("Test", readInputStream(s3));
assertMockEndpointsSatisfied();
}
[camel] 09/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, added example in docs
Posted by ac...@apache.org.
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 0c35d9f0672f5daee51f8cf34e41e20c00fcbd15
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 15:24:46 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, added example in docs
---
.../src/main/docs/aws2-s3-component.adoc | 19 +++++++++++++++++++
...CopyObjectCustomerKeyOperationIntegrationTest.java | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
index b68ae1f..2647176 100644
--- a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
+++ b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
@@ -526,6 +526,25 @@ This will require specifying the destinationBucket option. As example:
In this case the objects consumed will be moved to myothercamelbucket bucket and deleted from the original one (because of deleteAfterRead set to true as default).
+== Using customer key as encryption
+
+We introduced also the customer key support (an alternative of using KMS). The following code shows an example.
+
+[source,java]
+--------------------------------------------------------------------------------
+String key = UUID.randomUUID().toString();
+byte[] secretKey = generateSecretKey();
+String b64Key = Base64.getEncoder().encodeToString(secretKey);
+String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
+
+String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
+
+from("direct:putObject")
+ .setHeader(AWS2S3Constants.KEY, constant("test.txt"))
+ .setBody(constant("Test"))
+ .to(awsEndpoint);
+--------------------------------------------------------------------------------
+
== Dependencies
Maven users will need to add the following dependency to their pom.xml.
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
index fa723a9..d51a235 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
@@ -125,7 +125,7 @@ public class S3CopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSu
public void configure() throws Exception {
String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
String awsEndpoint1 = "aws2-s3://mycamel1?autoCreateBucket=false&pojoRequest=true";
- from("direct:putObject").to(awsEndpoint);
+ from("direct:putObject").setHeader(AWS2S3Constants.KEY, constant("test.txt")).setBody(constant("Test")).to(awsEndpoint);
from("direct:copyObject").to(awsEndpoint);
[camel] 02/10: CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't
support ServerSideEncryption, added an integration test
Posted by ac...@apache.org.
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 88f3ee4780badf48a77da787197863d34a00aede
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 17 14:44:45 2020 +0200
CAMEL-14845 - camel-aws2-s3 - CopyObject doesn't support ServerSideEncryption, added an integration test
---
.../aws2/s3/AWS2S3ComponentConfigurer.java | 20 ++++++
.../aws2/s3/AWS2S3EndpointConfigurer.java | 20 ++++++
.../apache/camel/component/aws2/s3/aws2-s3.json | 8 +++
.../src/main/docs/aws2-s3-component.adoc | 12 +++-
.../camel/component/aws2/s3/AWS2S3Producer.java | 5 +-
...ObjectCustomerKeyOperationIntegrationTest.java} | 2 +-
.../S3CopyObjectOperationIntegrationTest.java | 81 ++++++++++++++++++++--
.../dsl/Aws2S3ComponentBuilderFactory.java | 52 ++++++++++++++
.../endpoint/dsl/AWS2S3EndpointBuilderFactory.java | 62 +++++++++++++++++
9 files changed, 251 insertions(+), 11 deletions(-)
diff --git a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
index a4c64ae..2d5db39 100644
--- a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
+++ b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3ComponentConfigurer.java
@@ -41,6 +41,12 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.aws2.s3.AWS2S3Configuration.class, value)); return true;
+ case "customeralgorithm":
+ case "customerAlgorithm": getOrCreateConfiguration(target).setCustomerAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
+ case "customerkeyid":
+ case "customerKeyId": getOrCreateConfiguration(target).setCustomerKeyId(property(camelContext, java.lang.String.class, value)); return true;
+ case "customerkeymd5":
+ case "customerKeyMD5": getOrCreateConfiguration(target).setCustomerKeyMD5(property(camelContext, java.lang.String.class, value)); return true;
case "deleteafterread":
case "deleteAfterRead": getOrCreateConfiguration(target).setDeleteAfterRead(property(camelContext, boolean.class, value)); return true;
case "deleteafterwrite":
@@ -86,6 +92,8 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
case "useawskms":
case "useAwsKMS": getOrCreateConfiguration(target).setUseAwsKMS(property(camelContext, boolean.class, value)); return true;
+ case "usecustomerkey":
+ case "useCustomerKey": getOrCreateConfiguration(target).setUseCustomerKey(property(camelContext, boolean.class, value)); return true;
case "useiamcredentials":
case "useIAMCredentials": getOrCreateConfiguration(target).setUseIAMCredentials(property(camelContext, boolean.class, value)); return true;
default: return false;
@@ -103,6 +111,9 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
answer.put("basicPropertyBinding", boolean.class);
answer.put("bridgeErrorHandler", boolean.class);
answer.put("configuration", org.apache.camel.component.aws2.s3.AWS2S3Configuration.class);
+ answer.put("customerAlgorithm", java.lang.String.class);
+ answer.put("customerKeyId", java.lang.String.class);
+ answer.put("customerKeyMD5", java.lang.String.class);
answer.put("deleteAfterRead", boolean.class);
answer.put("deleteAfterWrite", boolean.class);
answer.put("delimiter", java.lang.String.class);
@@ -128,6 +139,7 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
answer.put("storageClass", java.lang.String.class);
answer.put("uriEndpointOverride", java.lang.String.class);
answer.put("useAwsKMS", boolean.class);
+ answer.put("useCustomerKey", boolean.class);
answer.put("useIAMCredentials", boolean.class);
return answer;
}
@@ -151,6 +163,12 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
case "configuration": return target.getConfiguration();
+ case "customeralgorithm":
+ case "customerAlgorithm": return getOrCreateConfiguration(target).getCustomerAlgorithm();
+ case "customerkeyid":
+ case "customerKeyId": return getOrCreateConfiguration(target).getCustomerKeyId();
+ case "customerkeymd5":
+ case "customerKeyMD5": return getOrCreateConfiguration(target).getCustomerKeyMD5();
case "deleteafterread":
case "deleteAfterRead": return getOrCreateConfiguration(target).isDeleteAfterRead();
case "deleteafterwrite":
@@ -196,6 +214,8 @@ public class AWS2S3ComponentConfigurer extends PropertyConfigurerSupport impleme
case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride();
case "useawskms":
case "useAwsKMS": return getOrCreateConfiguration(target).isUseAwsKMS();
+ case "usecustomerkey":
+ case "useCustomerKey": return getOrCreateConfiguration(target).isUseCustomerKey();
case "useiamcredentials":
case "useIAMCredentials": return getOrCreateConfiguration(target).isUseIAMCredentials();
default: return null;
diff --git a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
index 6d825e99..8f2ef4c 100644
--- a/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
+++ b/components/camel-aws2-s3/src/generated/java/org/apache/camel/component/aws2/s3/AWS2S3EndpointConfigurer.java
@@ -39,6 +39,12 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
+ case "customeralgorithm":
+ case "customerAlgorithm": target.getConfiguration().setCustomerAlgorithm(property(camelContext, java.lang.String.class, value)); return true;
+ case "customerkeyid":
+ case "customerKeyId": target.getConfiguration().setCustomerKeyId(property(camelContext, java.lang.String.class, value)); return true;
+ case "customerkeymd5":
+ case "customerKeyMD5": target.getConfiguration().setCustomerKeyMD5(property(camelContext, java.lang.String.class, value)); return true;
case "delay": target.setDelay(property(camelContext, long.class, value)); return true;
case "deleteafterread":
case "deleteAfterRead": target.getConfiguration().setDeleteAfterRead(property(camelContext, boolean.class, value)); return true;
@@ -114,6 +120,8 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
case "useawskms":
case "useAwsKMS": target.getConfiguration().setUseAwsKMS(property(camelContext, boolean.class, value)); return true;
+ case "usecustomerkey":
+ case "useCustomerKey": target.getConfiguration().setUseCustomerKey(property(camelContext, boolean.class, value)); return true;
case "usefixeddelay":
case "useFixedDelay": target.setUseFixedDelay(property(camelContext, boolean.class, value)); return true;
case "useiamcredentials":
@@ -135,6 +143,9 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
answer.put("backoffMultiplier", int.class);
answer.put("basicPropertyBinding", boolean.class);
answer.put("bridgeErrorHandler", boolean.class);
+ answer.put("customerAlgorithm", java.lang.String.class);
+ answer.put("customerKeyId", java.lang.String.class);
+ answer.put("customerKeyMD5", java.lang.String.class);
answer.put("delay", long.class);
answer.put("deleteAfterRead", boolean.class);
answer.put("deleteAfterWrite", boolean.class);
@@ -177,6 +188,7 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
answer.put("timeUnit", java.util.concurrent.TimeUnit.class);
answer.put("uriEndpointOverride", java.lang.String.class);
answer.put("useAwsKMS", boolean.class);
+ answer.put("useCustomerKey", boolean.class);
answer.put("useFixedDelay", boolean.class);
answer.put("useIAMCredentials", boolean.class);
return answer;
@@ -206,6 +218,12 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
case "basicPropertyBinding": return target.isBasicPropertyBinding();
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+ case "customeralgorithm":
+ case "customerAlgorithm": return target.getConfiguration().getCustomerAlgorithm();
+ case "customerkeyid":
+ case "customerKeyId": return target.getConfiguration().getCustomerKeyId();
+ case "customerkeymd5":
+ case "customerKeyMD5": return target.getConfiguration().getCustomerKeyMD5();
case "delay": return target.getDelay();
case "deleteafterread":
case "deleteAfterRead": return target.getConfiguration().isDeleteAfterRead();
@@ -281,6 +299,8 @@ public class AWS2S3EndpointConfigurer extends PropertyConfigurerSupport implemen
case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride();
case "useawskms":
case "useAwsKMS": return target.getConfiguration().isUseAwsKMS();
+ case "usecustomerkey":
+ case "useCustomerKey": return target.getConfiguration().isUseCustomerKey();
case "usefixeddelay":
case "useFixedDelay": return target.isUseFixedDelay();
case "useiamcredentials":
diff --git a/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json b/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
index 63daa44..1a18061 100644
--- a/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
+++ b/components/camel-aws2-s3/src/generated/resources/org/apache/camel/component/aws2/s3/aws2-s3.json
@@ -51,7 +51,11 @@
"partSize": { "kind": "property", "displayName": "Part Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "26214400", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Setup the partSize which is used in multi part upload, the default size is 25M." },
"storageClass": { "kind": "property", "displayName": "Storage Class", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request." },
"awsKMSKeyId": { "kind": "property", "displayName": "Aws KMSKey Id", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the id of KMS key to use in case KMS is enabled" },
+ "customerAlgorithm": { "kind": "property", "displayName": "Customer Algorithm", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the customer algorithm to use in case CustomerKey is enabled" },
+ "customerKeyId": { "kind": "property", "displayName": "Customer Key Id", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the id of Customer key to use in case CustomerKey is enabled" },
+ "customerKeyMD5": { "kind": "property", "displayName": "Customer Key MD5", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the MD5 of Customer key to use in case CustomerKey is enabled" },
"useAwsKMS": { "kind": "property", "displayName": "Use Aws KMS", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define if KMS must be used or not" },
+ "useCustomerKey": { "kind": "property", "displayName": "Use Customer Key", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define if Customer Key must be used or not" },
"basicPropertyBinding": { "kind": "property", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
"accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
"secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
@@ -93,7 +97,11 @@
"partSize": { "kind": "parameter", "displayName": "Part Size", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "secret": false, "defaultValue": "26214400", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Setup the partSize which is used in multi part upload, the default size is 25M." },
"storageClass": { "kind": "parameter", "displayName": "Storage Class", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request." },
"awsKMSKeyId": { "kind": "parameter", "displayName": "Aws KMSKey Id", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the id of KMS key to use in case KMS is enabled" },
+ "customerAlgorithm": { "kind": "parameter", "displayName": "Customer Algorithm", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the customer algorithm to use in case CustomerKey is enabled" },
+ "customerKeyId": { "kind": "parameter", "displayName": "Customer Key Id", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the id of Customer key to use in case CustomerKey is enabled" },
+ "customerKeyMD5": { "kind": "parameter", "displayName": "Customer Key MD5", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define the MD5 of Customer key to use in case CustomerKey is enabled" },
"useAwsKMS": { "kind": "parameter", "displayName": "Use Aws KMS", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define if KMS must be used or not" },
+ "useCustomerKey": { "kind": "parameter", "displayName": "Use Customer Key", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.s3.AWS2S3Configuration", "configurationField": "configuration", "description": "Define if Customer Key must be used or not" },
"basicPropertyBinding": { "kind": "parameter", "displayName": "Basic Property Binding", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": false, "description": "Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities" },
"synchronous": { "kind": "parameter", "displayName": "Synchronous", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "description": "Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported)." },
"backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." },
diff --git a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
index 7c8cc4c..b68ae1f 100644
--- a/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
+++ b/components/camel-aws2-s3/src/main/docs/aws2-s3-component.adoc
@@ -47,7 +47,7 @@ from("aws2-s3://helloBucket?accessKey=yourAccessKey&secretKey=yourSecretKey&pref
// component options: START
-The AWS2 S3 Storage Service component supports 34 options, which are listed below.
+The AWS2 S3 Storage Service component supports 38 options, which are listed below.
@@ -84,7 +84,11 @@ The AWS2 S3 Storage Service component supports 34 options, which are listed belo
| *partSize* (producer) | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | long
| *storageClass* (producer) | The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request. | | String
| *awsKMSKeyId* (producer) | Define the id of KMS key to use in case KMS is enabled | | String
+| *customerAlgorithm* (producer) | Define the customer algorithm to use in case CustomerKey is enabled | | String
+| *customerKeyId* (producer) | Define the id of Customer key to use in case CustomerKey is enabled | | String
+| *customerKeyMD5* (producer) | Define the MD5 of Customer key to use in case CustomerKey is enabled | | String
| *useAwsKMS* (producer) | Define if KMS must be used or not | false | boolean
+| *useCustomerKey* (producer) | Define if Customer Key must be used or not | false | boolean
| *basicPropertyBinding* (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *accessKey* (security) | Amazon AWS Access Key | | String
| *secretKey* (security) | Amazon AWS Secret Key | | String
@@ -120,7 +124,7 @@ with the following path and query parameters:
|===
-=== Query Parameters (54 parameters):
+=== Query Parameters (58 parameters):
[width="100%",cols="2,5,^1,2",options="header"]
@@ -161,7 +165,11 @@ with the following path and query parameters:
| *partSize* (producer) | Setup the partSize which is used in multi part upload, the default size is 25M. | 26214400 | long
| *storageClass* (producer) | The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request. | | String
| *awsKMSKeyId* (producer) | Define the id of KMS key to use in case KMS is enabled | | String
+| *customerAlgorithm* (producer) | Define the customer algorithm to use in case CustomerKey is enabled | | String
+| *customerKeyId* (producer) | Define the id of Customer key to use in case CustomerKey is enabled | | String
+| *customerKeyMD5* (producer) | Define the MD5 of Customer key to use in case CustomerKey is enabled | | String
| *useAwsKMS* (producer) | Define if KMS must be used or not | false | boolean
+| *useCustomerKey* (producer) | Define if Customer Key must be used or not | false | boolean
| *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
| *synchronous* (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean
| *backoffErrorThreshold* (scheduler) | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in. | | int
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 18d9722..8f90076 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
@@ -391,8 +391,6 @@ public class AWS2S3Producer extends DefaultProducer {
}
private void getObject(S3Client s3Client, Exchange exchange) throws InvalidPayloadException {
- final String bucketName = determineBucketName(exchange);
- final String sourceKey = determineKey(exchange);
if (getConfiguration().isPojoRequest()) {
Object payload = exchange.getIn().getMandatoryBody();
@@ -402,7 +400,8 @@ public class AWS2S3Producer extends DefaultProducer {
message.setBody(res);
}
} else {
-
+ final String bucketName = determineBucketName(exchange);
+ final String sourceKey = determineKey(exchange);
GetObjectRequest.Builder req = GetObjectRequest.builder().bucket(bucketName).key(sourceKey);
ResponseInputStream<GetObjectResponse> res = s3Client.getObject(req.build(), ResponseTransformer.toInputStream());
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
similarity index 97%
copy from components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
copy to components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
index b02c867..3726c27 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectCustomerKeyOperationIntegrationTest.java
@@ -34,7 +34,7 @@ import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
-public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
+public class S3CopyObjectCustomerKeyOperationIntegrationTest extends CamelTestSupport {
@BindToRegistry("amazonS3Client")
S3Client client = S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("xxx", "yyy"))).region(Region.EU_WEST_1).build();
diff --git a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
index b02c867..07c1843 100644
--- a/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
+++ b/components/camel-aws2-s3/src/test/java/org/apache/camel/component/aws2/s3/integration/S3CopyObjectOperationIntegrationTest.java
@@ -16,6 +16,21 @@
*/
package org.apache.camel.component.aws2.s3.integration;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
+import java.util.Base64;
+import java.util.UUID;
+
+import javax.crypto.KeyGenerator;
+
import org.apache.camel.BindToRegistry;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
@@ -26,14 +41,19 @@ import org.apache.camel.component.aws2.s3.AWS2S3Constants;
import org.apache.camel.component.aws2.s3.AWS2S3Operations;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.core.ResponseInputStream;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.S3Client;
+import software.amazon.awssdk.services.s3.model.GetObjectRequest;
+import software.amazon.awssdk.services.s3.model.GetObjectResponse;
+import software.amazon.awssdk.utils.Md5Utils;
+
+import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AES256;
-@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
+//@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
@BindToRegistry("amazonS3Client")
@@ -44,6 +64,11 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
@EndpointInject("mock:result")
private MockEndpoint result;
+
+ String key = UUID.randomUUID().toString();
+ byte[] secretKey = generateSecretKey();
+ String b64Key = Base64.getEncoder().encodeToString(secretKey);
+ String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
@Test
public void sendIn() throws Exception {
@@ -68,6 +93,27 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.copyObject);
}
});
+
+ Exchange res = template.request("direct:getObject", new Processor() {
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ GetObjectRequest getObjectRequest = GetObjectRequest.builder()
+ .key("test1.txt")
+ .bucket("mycamel1")
+ .sseCustomerKey(b64Key)
+ .sseCustomerAlgorithm(AES256.name())
+ .sseCustomerKeyMD5(b64KeyMd5)
+ .build();
+ exchange.getIn().setHeader(AWS2S3Constants.S3_OPERATION, AWS2S3Operations.getObject);
+ exchange.getIn().setBody(getObjectRequest);
+ }
+ });
+
+ ResponseInputStream<GetObjectResponse> s3 = res.getIn().getBody(ResponseInputStream.class);
+
+
+ assertEquals("Test", (readInputStream(s3)));
assertMockEndpointsSatisfied();
}
@@ -77,13 +123,38 @@ public class S3CopyObjectOperationIntegrationTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false";
-
+ String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
+ String awsEndpoint1 = "aws2-s3://mycamel1?autoCreateBucket=false&pojoRequest=true";
from("direct:putObject").to(awsEndpoint);
- from("direct:copyObject").to(awsEndpoint).to("mock:result");
+ from("direct:copyObject").to(awsEndpoint);
+
+ from("direct:getObject").to(awsEndpoint1).to("mock:result");
}
};
}
+
+ protected static byte[] generateSecretKey() {
+ KeyGenerator generator;
+ try {
+ generator = KeyGenerator.getInstance("AES");
+ generator.init(256, new SecureRandom());
+ return generator.generateKey().getEncoded();
+ } catch (Exception e) {
+ fail("Unable to generate symmetric key: " + e.getMessage());
+ return null;
+ }
+ }
+
+ private String readInputStream(ResponseInputStream<GetObjectResponse> s3Object) throws IOException {
+ StringBuilder textBuilder = new StringBuilder();
+ try (Reader reader = new BufferedReader(new InputStreamReader(s3Object, Charset.forName(StandardCharsets.UTF_8.name())))) {
+ int c = 0;
+ while ((c = reader.read()) != -1) {
+ textBuilder.append((char)c);
+ }
+ }
+ return textBuilder.toString();
+ }
}
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
index df97ea4..2a2ee38 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2S3ComponentBuilderFactory.java
@@ -466,6 +466,42 @@ public interface Aws2S3ComponentBuilderFactory {
return this;
}
/**
+ * Define the customer algorithm to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default Aws2S3ComponentBuilder customerAlgorithm(
+ java.lang.String customerAlgorithm) {
+ doSetProperty("customerAlgorithm", customerAlgorithm);
+ return this;
+ }
+ /**
+ * Define the id of Customer key to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default Aws2S3ComponentBuilder customerKeyId(
+ java.lang.String customerKeyId) {
+ doSetProperty("customerKeyId", customerKeyId);
+ return this;
+ }
+ /**
+ * Define the MD5 of Customer key to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default Aws2S3ComponentBuilder customerKeyMD5(
+ java.lang.String customerKeyMD5) {
+ doSetProperty("customerKeyMD5", customerKeyMD5);
+ return this;
+ }
+ /**
* Define if KMS must be used or not.
*
* The option is a: <code>boolean</code> type.
@@ -478,6 +514,18 @@ public interface Aws2S3ComponentBuilderFactory {
return this;
}
/**
+ * Define if Customer Key must be used or not.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer (advanced)
+ */
+ default Aws2S3ComponentBuilder useCustomerKey(boolean useCustomerKey) {
+ doSetProperty("useCustomerKey", useCustomerKey);
+ return this;
+ }
+ /**
* Whether the component should use basic property binding (Camel 2.x)
* or the newer property binding with additional capabilities.
*
@@ -567,7 +615,11 @@ public interface Aws2S3ComponentBuilderFactory {
case "partSize": getOrCreateConfiguration((AWS2S3Component) component).setPartSize((long) value); return true;
case "storageClass": getOrCreateConfiguration((AWS2S3Component) component).setStorageClass((java.lang.String) value); return true;
case "awsKMSKeyId": getOrCreateConfiguration((AWS2S3Component) component).setAwsKMSKeyId((java.lang.String) value); return true;
+ case "customerAlgorithm": getOrCreateConfiguration((AWS2S3Component) component).setCustomerAlgorithm((java.lang.String) value); return true;
+ case "customerKeyId": getOrCreateConfiguration((AWS2S3Component) component).setCustomerKeyId((java.lang.String) value); return true;
+ case "customerKeyMD5": getOrCreateConfiguration((AWS2S3Component) component).setCustomerKeyMD5((java.lang.String) value); return true;
case "useAwsKMS": getOrCreateConfiguration((AWS2S3Component) component).setUseAwsKMS((boolean) value); return true;
+ case "useCustomerKey": getOrCreateConfiguration((AWS2S3Component) component).setUseCustomerKey((boolean) value); return true;
case "basicPropertyBinding": ((AWS2S3Component) component).setBasicPropertyBinding((boolean) value); return true;
case "accessKey": getOrCreateConfiguration((AWS2S3Component) component).setAccessKey((java.lang.String) value); return true;
case "secretKey": getOrCreateConfiguration((AWS2S3Component) component).setSecretKey((java.lang.String) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
index 976cc31..b53e78f 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/AWS2S3EndpointBuilderFactory.java
@@ -1636,6 +1636,42 @@ public interface AWS2S3EndpointBuilderFactory {
return this;
}
/**
+ * Define the customer algorithm to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default AdvancedAWS2S3EndpointProducerBuilder customerAlgorithm(
+ String customerAlgorithm) {
+ doSetProperty("customerAlgorithm", customerAlgorithm);
+ return this;
+ }
+ /**
+ * Define the id of Customer key to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default AdvancedAWS2S3EndpointProducerBuilder customerKeyId(
+ String customerKeyId) {
+ doSetProperty("customerKeyId", customerKeyId);
+ return this;
+ }
+ /**
+ * Define the MD5 of Customer key to use in case CustomerKey is enabled.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: producer (advanced)
+ */
+ default AdvancedAWS2S3EndpointProducerBuilder customerKeyMD5(
+ String customerKeyMD5) {
+ doSetProperty("customerKeyMD5", customerKeyMD5);
+ return this;
+ }
+ /**
* Define if KMS must be used or not.
*
* The option is a: <code>boolean</code> type.
@@ -1661,6 +1697,32 @@ public interface AWS2S3EndpointBuilderFactory {
return this;
}
/**
+ * Define if Customer Key must be used or not.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer (advanced)
+ */
+ default AdvancedAWS2S3EndpointProducerBuilder useCustomerKey(
+ boolean useCustomerKey) {
+ doSetProperty("useCustomerKey", useCustomerKey);
+ return this;
+ }
+ /**
+ * Define if Customer Key must be used or not.
+ *
+ * The option will be converted to a <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: producer (advanced)
+ */
+ default AdvancedAWS2S3EndpointProducerBuilder useCustomerKey(
+ String useCustomerKey) {
+ doSetProperty("useCustomerKey", useCustomerKey);
+ return this;
+ }
+ /**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*