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 2021/05/14 06:08:31 UTC

[camel] branch main updated (8b6af4a -> 72a4c5a)

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

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


    from 8b6af4a  CAMEL-16608: Kamelet local bean - Using script should allow to define return type of created bean
     new bbb75c7  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
     new 2ede2b7  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
     new 267fd3c  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
     new 1b2cee3  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
     new 9712e8f  Regen
     new 43522a9  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - IAM Component
     new 72a4c5a  CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

The 7 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:
 .../apache/camel/catalog/components/aws2-kms.json  |  2 +
 .../camel/catalog/docs/aws2-kms-component.adoc     |  6 +-
 .../apache/camel/catalog/schemas/camel-spring.xsd  |  1 -
 .../component/aws2/iam/IAMClientFactoryTest.java   | 51 ++++++++++++
 .../aws2/kms/KMS2ComponentConfigurer.java          |  6 ++
 .../component/aws2/kms/KMS2EndpointConfigurer.java |  6 ++
 .../component/aws2/kms/KMS2EndpointUriFactory.java |  3 +-
 .../apache/camel/component/aws2/kms/aws2-kms.json  |  2 +
 .../src/main/docs/aws2-kms-component.adoc          |  6 +-
 .../camel/component/aws2/kms/KMS2Component.java    |  5 +-
 .../component/aws2/kms/KMS2Configuration.java      | 13 ++++
 .../camel/component/aws2/kms/KMS2Endpoint.java     | 62 +--------------
 .../aws2/kms/client/KMS2ClientFactory.java         | 41 ++++++++++
 .../aws2/kms/client/KMS2InternalClient.java        | 32 ++++++++
 .../impl/KMS2ClientOptimizedImpl.java}             | 90 +++++-----------------
 .../impl/KMS2ClientStandardImpl.java}              | 72 +++++------------
 .../component/aws2/kms/KMSClientFactoryTest.java   | 51 ++++++++++++
 .../dsl/Aws2KmsComponentBuilderFactory.java        | 19 +++++
 .../endpoint/dsl/KMS2EndpointBuilderFactory.java   | 37 +++++++++
 .../modules/ROOT/pages/aws2-kms-component.adoc     |  6 +-
 20 files changed, 320 insertions(+), 191 deletions(-)
 create mode 100644 components/camel-aws/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMClientFactoryTest.java
 create mode 100644 components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2ClientFactory.java
 create mode 100644 components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2InternalClient.java
 copy components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/{KMS2Endpoint.java => client/impl/KMS2ClientOptimizedImpl.java} (52%)
 copy components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/{KMS2Endpoint.java => client/impl/KMS2ClientStandardImpl.java} (69%)
 create mode 100644 components/camel-aws/camel-aws2-kms/src/test/java/org/apache/camel/component/aws2/kms/KMSClientFactoryTest.java

[camel] 01/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bbb75c76f5bf756705b3363f21869c1eea52a090
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:17:28 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
---
 .../apache/camel/component/aws2/kms/KMS2Configuration.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Configuration.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Configuration.java
index 8ba2ab0..1202f33 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Configuration.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Configuration.java
@@ -56,6 +56,8 @@ public class KMS2Configuration implements Cloneable {
     private boolean overrideEndpoint;
     @UriParam
     private String uriEndpointOverride;
+    @UriParam(defaultValue = "false")
+    private boolean useDefaultCredentialsProvider;
 
     public KmsClient getKmsClient() {
         return kmsClient;
@@ -191,6 +193,17 @@ public class KMS2Configuration implements Cloneable {
         this.uriEndpointOverride = uriEndpointOverride;
     }
 
+    /**
+     * Set whether the KMS client should expect to load credentials through a default credentials provider or to expect
+     * static credentials to be passed in.
+     */
+    public void setUseDefaultCredentialsProvider(Boolean useDefaultCredentialsProvider) {
+        this.useDefaultCredentialsProvider = useDefaultCredentialsProvider;
+    }
+
+    public Boolean isUseDefaultCredentialsProvider() {
+        return useDefaultCredentialsProvider;
+    }
     // *************************************************
     //
     // *************************************************

[camel] 07/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 72a4c5a988cc7d331eb83bc91ee49a0e7ec13d70
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:58:47 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
---
 .../component/aws2/kms/KMSClientFactoryTest.java   | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/components/camel-aws/camel-aws2-kms/src/test/java/org/apache/camel/component/aws2/kms/KMSClientFactoryTest.java b/components/camel-aws/camel-aws2-kms/src/test/java/org/apache/camel/component/aws2/kms/KMSClientFactoryTest.java
new file mode 100644
index 0000000..f008ab4e
--- /dev/null
+++ b/components/camel-aws/camel-aws2-kms/src/test/java/org/apache/camel/component/aws2/kms/KMSClientFactoryTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.kms;
+
+import org.apache.camel.component.aws2.kms.client.KMS2ClientFactory;
+import org.apache.camel.component.aws2.kms.client.KMS2InternalClient;
+import org.apache.camel.component.aws2.kms.client.impl.KMS2ClientOptimizedImpl;
+import org.apache.camel.component.aws2.kms.client.impl.KMS2ClientStandardImpl;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class KMSClientFactoryTest {
+
+    @Test
+    public void getStandardKMSClientDefault() {
+        KMS2Configuration kms2Configuration = new KMS2Configuration();
+        KMS2InternalClient kmsClient = KMS2ClientFactory.getKmsClient(kms2Configuration);
+        assertTrue(kmsClient instanceof KMS2ClientStandardImpl);
+    }
+
+    @Test
+    public void getStandardKMSClient() {
+        KMS2Configuration kms2Configuration = new KMS2Configuration();
+        kms2Configuration.setUseDefaultCredentialsProvider(false);
+        KMS2InternalClient kmsClient = KMS2ClientFactory.getKmsClient(kms2Configuration);
+        assertTrue(kmsClient instanceof KMS2ClientStandardImpl);
+    }
+
+    @Test
+    public void getIAMOptimizedKMSClient() {
+        KMS2Configuration kms2Configuration = new KMS2Configuration();
+        kms2Configuration.setUseDefaultCredentialsProvider(true);
+        KMS2InternalClient kmsClient = KMS2ClientFactory.getKmsClient(kms2Configuration);
+        assertTrue(kmsClient instanceof KMS2ClientOptimizedImpl);
+    }
+}

[camel] 06/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - IAM Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 43522a90a3c7f2687afe79b83dfb5d6995695029
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:55:27 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - IAM Component
---
 .../component/aws2/iam/IAMClientFactoryTest.java   | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/components/camel-aws/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMClientFactoryTest.java b/components/camel-aws/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMClientFactoryTest.java
new file mode 100644
index 0000000..1d055d1
--- /dev/null
+++ b/components/camel-aws/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMClientFactoryTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.iam;
+
+import org.apache.camel.component.aws2.iam.client.IAM2ClientFactory;
+import org.apache.camel.component.aws2.iam.client.IAM2InternalClient;
+import org.apache.camel.component.aws2.iam.client.impl.IAM2ClientOptimizedImpl;
+import org.apache.camel.component.aws2.iam.client.impl.IAM2ClientStandardImpl;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class IAMClientFactoryTest {
+
+    @Test
+    public void getStandardEIamClientDefault() {
+        IAM2Configuration iam2Configuration = new IAM2Configuration();
+        IAM2InternalClient iamClient = IAM2ClientFactory.getIamClient(iam2Configuration);
+        assertTrue(iamClient instanceof IAM2ClientStandardImpl);
+    }
+
+    @Test
+    public void getStandardIamClient() {
+        IAM2Configuration iam2Configuration = new IAM2Configuration();
+        iam2Configuration.setUseDefaultCredentialsProvider(false);
+        IAM2InternalClient iamClient = IAM2ClientFactory.getIamClient(iam2Configuration);
+        assertTrue(iamClient instanceof IAM2ClientStandardImpl);
+    }
+
+    @Test
+    public void getIAMOptimizedIamClient() {
+        IAM2Configuration iam2Configuration = new IAM2Configuration();
+        iam2Configuration.setUseDefaultCredentialsProvider(true);
+        IAM2InternalClient iamClient = IAM2ClientFactory.getIamClient(iam2Configuration);
+        assertTrue(iamClient instanceof IAM2ClientOptimizedImpl);
+    }
+}

[camel] 04/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1b2cee3a8c1d4d562d6ee7a4c1648a126d087885
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:25:47 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
---
 .../camel/catalog/docs/aws2-kms-component.adoc     |  6 ++--
 .../aws2/kms/KMS2ComponentConfigurer.java          |  6 ++++
 .../component/aws2/kms/KMS2EndpointConfigurer.java |  6 ++++
 .../component/aws2/kms/KMS2EndpointUriFactory.java |  3 +-
 .../apache/camel/component/aws2/kms/aws2-kms.json  |  2 ++
 .../src/main/docs/aws2-kms-component.adoc          |  6 ++--
 .../camel/component/aws2/kms/KMS2Component.java    |  3 +-
 .../camel/component/aws2/kms/KMS2Endpoint.java     | 11 -------
 .../kms/client/impl/KMS2ClientOptimizedImpl.java   |  4 +--
 .../kms/client/impl/KMS2ClientStandardImpl.java    |  4 +--
 .../dsl/Aws2KmsComponentBuilderFactory.java        | 19 +++++++++++
 .../endpoint/dsl/KMS2EndpointBuilderFactory.java   | 37 ++++++++++++++++++++++
 .../modules/ROOT/pages/aws2-kms-component.adoc     |  6 ++--
 13 files changed, 90 insertions(+), 23 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-kms-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-kms-component.adoc
index f88b058..f99b7ff 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-kms-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-kms-component.adoc
@@ -42,7 +42,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Key Management Service (KMS) component supports 15 options, which are listed below.
+The AWS 2 Key Management Service (KMS) component supports 16 options, which are listed below.
 
 
 
@@ -61,6 +61,7 @@ The AWS 2 Key Management Service (KMS) component supports 15 options, which are
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
@@ -89,7 +90,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -106,6 +107,7 @@ with the following path and query parameters:
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
diff --git a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2ComponentConfigurer.java b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2ComponentConfigurer.java
index 6e9a0cb..8ac428d 100644
--- a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2ComponentConfigurer.java
+++ b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2ComponentConfigurer.java
@@ -55,6 +55,8 @@ public class KMS2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
         case "uriendpointoverride":
         case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": getOrCreateConfiguration(target).setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -94,6 +96,8 @@ public class KMS2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "trustAllCertificates": return boolean.class;
         case "uriendpointoverride":
         case "uriEndpointOverride": return java.lang.String.class;
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": return boolean.class;
         default: return null;
         }
     }
@@ -129,6 +133,8 @@ public class KMS2ComponentConfigurer extends PropertyConfigurerSupport implement
         case "trustAllCertificates": return getOrCreateConfiguration(target).isTrustAllCertificates();
         case "uriendpointoverride":
         case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride();
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": return getOrCreateConfiguration(target).isUseDefaultCredentialsProvider();
         default: return null;
         }
     }
diff --git a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointConfigurer.java b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointConfigurer.java
index 21dad82..ee07071 100644
--- a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointConfigurer.java
+++ b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointConfigurer.java
@@ -45,6 +45,8 @@ public class KMS2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true;
         case "uriendpointoverride":
         case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true;
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": target.getConfiguration().setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -81,6 +83,8 @@ public class KMS2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "trustAllCertificates": return boolean.class;
         case "uriendpointoverride":
         case "uriEndpointOverride": return java.lang.String.class;
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": return boolean.class;
         default: return null;
         }
     }
@@ -113,6 +117,8 @@ public class KMS2EndpointConfigurer extends PropertyConfigurerSupport implements
         case "trustAllCertificates": return target.getConfiguration().isTrustAllCertificates();
         case "uriendpointoverride":
         case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride();
+        case "usedefaultcredentialsprovider":
+        case "useDefaultCredentialsProvider": return target.getConfiguration().isUseDefaultCredentialsProvider();
         default: return null;
         }
     }
diff --git a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointUriFactory.java b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointUriFactory.java
index 515f8ac..90af4fe 100644
--- a/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointUriFactory.java
+++ b/components/camel-aws/camel-aws2-kms/src/generated/java/org/apache/camel/component/aws2/kms/KMS2EndpointUriFactory.java
@@ -20,11 +20,12 @@ public class KMS2EndpointUriFactory extends org.apache.camel.support.component.E
     private static final Set<String> PROPERTY_NAMES;
     private static final Set<String> SECRET_PROPERTY_NAMES;
     static {
-        Set<String> props = new HashSet<>(14);
+        Set<String> props = new HashSet<>(15);
         props.add("kmsClient");
         props.add("proxyProtocol");
         props.add("secretKey");
         props.add("uriEndpointOverride");
+        props.add("useDefaultCredentialsProvider");
         props.add("label");
         props.add("pojoRequest");
         props.add("proxyHost");
diff --git a/components/camel-aws/camel-aws2-kms/src/generated/resources/org/apache/camel/component/aws2/kms/aws2-kms.json b/components/camel-aws/camel-aws2-kms/src/generated/resources/org/apache/camel/component/aws2/kms/aws2-kms.json
index d097651..8783e0e 100644
--- a/components/camel-aws/camel-aws2-kms/src/generated/resources/org/apache/camel/component/aws2/kms/aws2-kms.json
+++ b/components/camel-aws/camel-aws2-kms/src/generated/resources/org/apache/camel/component/aws2/kms/aws2-kms.json
@@ -34,6 +34,7 @@
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region  [...]
     "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
+    "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set whether the KMS client should expect to load credentials through a d [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
     "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "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, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
@@ -51,6 +52,7 @@
     "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region [...]
     "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
+    "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set whether the KMS client should expect to load credentials through a  [...]
     "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   }
diff --git a/components/camel-aws/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc b/components/camel-aws/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc
index f88b058..f99b7ff 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc
+++ b/components/camel-aws/camel-aws2-kms/src/main/docs/aws2-kms-component.adoc
@@ -42,7 +42,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Key Management Service (KMS) component supports 15 options, which are listed below.
+The AWS 2 Key Management Service (KMS) component supports 16 options, which are listed below.
 
 
 
@@ -61,6 +61,7 @@ The AWS 2 Key Management Service (KMS) component supports 15 options, which are
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
@@ -89,7 +90,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -106,6 +107,7 @@ with the following path and query parameters:
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
index 6a1fed4..bbaceb8 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
@@ -55,7 +55,8 @@ public class KMS2Component extends DefaultComponent {
         setProperties(endpoint, parameters);
         if (!configuration.isUseDefaultCredentialsProvider() && configuration.getKmsClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
-            throw new IllegalArgumentException("useDefaultCredentialsProvider is set to false, Amazon kms client or accessKey and secretKey must be specified");
+            throw new IllegalArgumentException(
+                    "useDefaultCredentialsProvider is set to false, Amazon kms client or accessKey and secretKey must be specified");
         }
 
         return endpoint;
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
index 72a266b..619b83f 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.aws2.kms;
 
-import java.net.URI;
-
 import org.apache.camel.Category;
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
@@ -28,16 +26,7 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.ScheduledPollEndpoint;
 import org.apache.camel.util.ObjectHelper;
-import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
-import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
-import software.amazon.awssdk.http.SdkHttpClient;
-import software.amazon.awssdk.http.SdkHttpConfigurationOption;
-import software.amazon.awssdk.http.apache.ApacheHttpClient;
-import software.amazon.awssdk.http.apache.ProxyConfiguration;
-import software.amazon.awssdk.regions.Region;
 import software.amazon.awssdk.services.kms.KmsClient;
-import software.amazon.awssdk.services.kms.KmsClientBuilder;
-import software.amazon.awssdk.utils.AttributeMap;
 
 /**
  * Manage keys stored in AWS KMS instances using AWS SDK version 2.x.
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java
index 36648cb..f71c9d8 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.aws2.kms.client.impl;
 
+import java.net.URI;
+
 import org.apache.camel.component.aws2.kms.KMS2Configuration;
 import org.apache.camel.component.aws2.kms.client.KMS2InternalClient;
 import org.apache.camel.util.ObjectHelper;
@@ -30,8 +32,6 @@ import software.amazon.awssdk.services.kms.KmsClient;
 import software.amazon.awssdk.services.kms.KmsClientBuilder;
 import software.amazon.awssdk.utils.AttributeMap;
 
-import java.net.URI;
-
 /**
  * Manage an AWS KMS client for all users to use (enabling temporary creds). This implementation is for remote instances
  * to manage the credentials on their own (eliminating credential rotations)
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java
index ced9cbb..81d7404 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.aws2.kms.client.impl;
 
+import java.net.URI;
+
 import org.apache.camel.component.aws2.kms.KMS2Configuration;
 import org.apache.camel.component.aws2.kms.client.KMS2InternalClient;
 import org.apache.camel.util.ObjectHelper;
@@ -32,8 +34,6 @@ import software.amazon.awssdk.services.kms.KmsClient;
 import software.amazon.awssdk.services.kms.KmsClientBuilder;
 import software.amazon.awssdk.utils.AttributeMap;
 
-import java.net.URI;
-
 /**
  * Manage an AWS KMS client for all users to use. This implementation is for local instances to use a static and solid
  * credential set.
diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KmsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KmsComponentBuilderFactory.java
index 64a8ffd..ef939a0 100644
--- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KmsComponentBuilderFactory.java
+++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2KmsComponentBuilderFactory.java
@@ -248,6 +248,24 @@ public interface Aws2KmsComponentBuilderFactory {
             return this;
         }
         /**
+         * Set whether the KMS client should expect to load credentials through
+         * a default credentials provider or to expect static credentials to be
+         * passed in.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useDefaultCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default Aws2KmsComponentBuilder useDefaultCredentialsProvider(
+                boolean useDefaultCredentialsProvider) {
+            doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+            return this;
+        }
+        /**
          * Whether autowiring is enabled. This is used for automatic autowiring
          * options (the option must be marked as autowired) by looking up in the
          * registry to find if there is a single instance of matching type,
@@ -332,6 +350,7 @@ public interface Aws2KmsComponentBuilderFactory {
             case "region": getOrCreateConfiguration((KMS2Component) component).setRegion((java.lang.String) value); return true;
             case "trustAllCertificates": getOrCreateConfiguration((KMS2Component) component).setTrustAllCertificates((boolean) value); return true;
             case "uriEndpointOverride": getOrCreateConfiguration((KMS2Component) component).setUriEndpointOverride((java.lang.String) value); return true;
+            case "useDefaultCredentialsProvider": getOrCreateConfiguration((KMS2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true;
             case "autowiredEnabled": ((KMS2Component) component).setAutowiredEnabled((boolean) value); return true;
             case "accessKey": getOrCreateConfiguration((KMS2Component) component).setAccessKey((java.lang.String) value); return true;
             case "secretKey": getOrCreateConfiguration((KMS2Component) component).setSecretKey((java.lang.String) value); return true;
diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java
index eaeefae..120505a 100644
--- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java
+++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/KMS2EndpointBuilderFactory.java
@@ -352,6 +352,43 @@ public interface KMS2EndpointBuilderFactory {
             return this;
         }
         /**
+         * Set whether the KMS client should expect to load credentials through
+         * a default credentials provider or to expect static credentials to be
+         * passed in.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useDefaultCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default KMS2EndpointBuilder useDefaultCredentialsProvider(
+                boolean useDefaultCredentialsProvider) {
+            doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+            return this;
+        }
+        /**
+         * Set whether the KMS client should expect to load credentials through
+         * a default credentials provider or to expect static credentials to be
+         * passed in.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useDefaultCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default KMS2EndpointBuilder useDefaultCredentialsProvider(
+                String useDefaultCredentialsProvider) {
+            doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
+            return this;
+        }
+        /**
          * Amazon AWS Access Key.
          * 
          * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
diff --git a/docs/components/modules/ROOT/pages/aws2-kms-component.adoc b/docs/components/modules/ROOT/pages/aws2-kms-component.adoc
index a5563bb..0e14343 100644
--- a/docs/components/modules/ROOT/pages/aws2-kms-component.adoc
+++ b/docs/components/modules/ROOT/pages/aws2-kms-component.adoc
@@ -44,7 +44,7 @@ You can append query options to the URI in the following format,
 
 
 // component options: START
-The AWS 2 Key Management Service (KMS) component supports 15 options, which are listed below.
+The AWS 2 Key Management Service (KMS) component supports 16 options, which are listed below.
 
 
 
@@ -63,6 +63,7 @@ The AWS 2 Key Management Service (KMS) component supports 15 options, which are
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
@@ -91,7 +92,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (14 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -108,6 +109,7 @@ with the following path and query parameters:
 | *region* (producer) | The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() |  | String
 | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean
 | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
+| *useDefaultCredentialsProvider* (producer) | Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean
 | *accessKey* (security) | Amazon AWS Access Key |  | String
 | *secretKey* (security) | Amazon AWS Secret Key |  | String
 |===

[camel] 05/07: Regen

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9712e8fd1c75c881bb4afa4901ca656300da8fb5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:52:35 2021 +0200

    Regen
---
 .../resources/org/apache/camel/catalog/components/aws2-kms.json         | 2 ++
 .../resources/org/apache/camel/catalog/schemas/camel-spring.xsd         | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-kms.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-kms.json
index d097651..8783e0e 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-kms.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-kms.json
@@ -34,6 +34,7 @@
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region  [...]
     "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
+    "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set whether the KMS client should expect to load credentials through a d [...]
     "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
     "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "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, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
@@ -51,6 +52,7 @@
     "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region [...]
     "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
     "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
+    "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Set whether the KMS client should expect to load credentials through a  [...]
     "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
     "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.kms.KMS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   }
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 3beb64c..959399b 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -14050,7 +14050,6 @@ to refer to an existing data format instance.
       <xs:extension base="tns:optionalIdentifiedDefinition">
         <xs:sequence>
           <xs:element minOccurs="0" ref="tns:securityDefinitions"/>
-          <xs:element minOccurs="0" ref="tns:securityRequirements"/>
           <xs:choice maxOccurs="unbounded" minOccurs="0">
             <xs:element ref="tns:verb"/>
             <xs:element ref="tns:delete"/>

[camel] 02/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2ede2b763fe0ba65db315235646e1e5d011a54f7
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:17:40 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
---
 .../aws2/kms/client/KMS2ClientFactory.java         |  41 ++++++++
 .../aws2/kms/client/KMS2InternalClient.java        |  32 +++++++
 .../kms/client/impl/KMS2ClientOptimizedImpl.java   |  88 +++++++++++++++++
 .../kms/client/impl/KMS2ClientStandardImpl.java    | 104 +++++++++++++++++++++
 4 files changed, 265 insertions(+)

diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2ClientFactory.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2ClientFactory.java
new file mode 100644
index 0000000..f56dd7f
--- /dev/null
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2ClientFactory.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.kms.client;
+
+import org.apache.camel.component.aws2.kms.KMS2Configuration;
+import org.apache.camel.component.aws2.kms.client.impl.KMS2ClientOptimizedImpl;
+import org.apache.camel.component.aws2.kms.client.impl.KMS2ClientStandardImpl;
+
+/**
+ * Factory class to return the correct type of AWS Eventbridge client.
+ */
+public final class KMS2ClientFactory {
+
+    private KMS2ClientFactory() {
+    }
+
+    /**
+     * Return the correct AWS KMS client (based on remote vs local).
+     * 
+     * @param  configuration configuration
+     * @return               KMSClient
+     */
+    public static KMS2InternalClient getKmsClient(KMS2Configuration configuration) {
+        return configuration.isUseDefaultCredentialsProvider()
+                ? new KMS2ClientOptimizedImpl(configuration) : new KMS2ClientStandardImpl(configuration);
+    }
+}
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2InternalClient.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2InternalClient.java
new file mode 100644
index 0000000..eeb7bf3
--- /dev/null
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/KMS2InternalClient.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.kms.client;
+
+import software.amazon.awssdk.services.kms.KmsClient;
+
+/**
+ * Manage the required actions of an KMS client for either local or remote.
+ */
+public interface KMS2InternalClient {
+
+    /**
+     * Returns an KMS client after a factory method determines which one to return.
+     * 
+     * @return KmsClient KmsClient
+     */
+    KmsClient getKmsClient();
+}
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java
new file mode 100644
index 0000000..36648cb
--- /dev/null
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientOptimizedImpl.java
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.kms.client.impl;
+
+import org.apache.camel.component.aws2.kms.KMS2Configuration;
+import org.apache.camel.component.aws2.kms.client.KMS2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.kms.KmsClient;
+import software.amazon.awssdk.services.kms.KmsClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+import java.net.URI;
+
+/**
+ * Manage an AWS KMS client for all users to use (enabling temporary creds). This implementation is for remote instances
+ * to manage the credentials on their own (eliminating credential rotations)
+ */
+public class KMS2ClientOptimizedImpl implements KMS2InternalClient {
+    private static final Logger LOG = LoggerFactory.getLogger(KMS2ClientOptimizedImpl.class);
+    private KMS2Configuration configuration;
+
+    /**
+     * Constructor that uses the config file.
+     */
+    public KMS2ClientOptimizedImpl(KMS2Configuration configuration) {
+        LOG.trace("Creating an AWS KMS client for an ec2 instance with IAM temporary credentials (normal for ec2s).");
+        this.configuration = configuration;
+    }
+
+    /**
+     * Getting the KMS aws client that is used.
+     * 
+     * @return KMS Client.
+     */
+    @Override
+    public KmsClient getKmsClient() {
+        KmsClient client = null;
+        KmsClientBuilder clientBuilder = KmsClient.builder();
+        ProxyConfiguration.Builder proxyConfig = null;
+        ApacheHttpClient.Builder httpClientBuilder = null;
+        if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+            proxyConfig = ProxyConfiguration.builder();
+            URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+                                           + configuration.getProxyPort());
+            proxyConfig.endpoint(proxyEndpoint);
+            httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+            clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+        }
+        if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+            clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+        }
+        if (configuration.isOverrideEndpoint()) {
+            clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+        }
+        if (configuration.isTrustAllCertificates()) {
+            SdkHttpClient ahc = ApacheHttpClient.builder().buildWithDefaults(AttributeMap
+                    .builder()
+                    .put(
+                            SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+                            Boolean.TRUE)
+                    .build());
+            clientBuilder.httpClient(ahc);
+        }
+        client = clientBuilder.build();
+        return client;
+    }
+}
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java
new file mode 100644
index 0000000..ced9cbb
--- /dev/null
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/client/impl/KMS2ClientStandardImpl.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.kms.client.impl;
+
+import org.apache.camel.component.aws2.kms.KMS2Configuration;
+import org.apache.camel.component.aws2.kms.client.KMS2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.http.SdkHttpClient;
+import software.amazon.awssdk.http.SdkHttpConfigurationOption;
+import software.amazon.awssdk.http.apache.ApacheHttpClient;
+import software.amazon.awssdk.http.apache.ProxyConfiguration;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.kms.KmsClient;
+import software.amazon.awssdk.services.kms.KmsClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+import java.net.URI;
+
+/**
+ * Manage an AWS KMS client for all users to use. This implementation is for local instances to use a static and solid
+ * credential set.
+ */
+public class KMS2ClientStandardImpl implements KMS2InternalClient {
+    private static final Logger LOG = LoggerFactory.getLogger(KMS2ClientStandardImpl.class);
+    private KMS2Configuration configuration;
+
+    /**
+     * Constructor that uses the config file.
+     */
+    public KMS2ClientStandardImpl(KMS2Configuration configuration) {
+        LOG.trace("Creating an AWS KMS manager using static credentials.");
+        this.configuration = configuration;
+    }
+
+    /**
+     * Getting the KMS AWS client that is used.
+     * 
+     * @return Amazon KMS Client.
+     */
+    @Override
+    public KmsClient getKmsClient() {
+        KmsClient client = null;
+        KmsClientBuilder clientBuilder = KmsClient.builder();
+        ProxyConfiguration.Builder proxyConfig = null;
+        ApacheHttpClient.Builder httpClientBuilder = null;
+        boolean isClientConfigFound = false;
+        if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
+            proxyConfig = ProxyConfiguration.builder();
+            URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
+                                           + configuration.getProxyPort());
+            proxyConfig.endpoint(proxyEndpoint);
+            httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
+            isClientConfigFound = true;
+        }
+        if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
+            AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
+            if (isClientConfigFound) {
+                clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
+                        .credentialsProvider(StaticCredentialsProvider.create(cred));
+            } else {
+                clientBuilder = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
+            }
+        } else {
+            if (!isClientConfigFound) {
+                clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
+            }
+        }
+        if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+            clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
+        }
+        if (configuration.isOverrideEndpoint()) {
+            clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
+        }
+        if (configuration.isTrustAllCertificates()) {
+            SdkHttpClient ahc = ApacheHttpClient.builder().buildWithDefaults(AttributeMap
+                    .builder()
+                    .put(
+                            SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
+                            Boolean.TRUE)
+                    .build());
+            clientBuilder.httpClient(ahc);
+        }
+        client = clientBuilder.build();
+        return client;
+    }
+}

[camel] 03/07: CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 267fd3c2d6d5305e92687a3c1f86beab01700ef5
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri May 14 07:20:04 2021 +0200

    CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - KMS Component
---
 .../camel/component/aws2/kms/KMS2Component.java    |  4 +-
 .../camel/component/aws2/kms/KMS2Endpoint.java     | 51 ++--------------------
 2 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
index 8aa7558..6a1fed4 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Component.java
@@ -53,9 +53,9 @@ public class KMS2Component extends DefaultComponent {
 
         KMS2Endpoint endpoint = new KMS2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
-        if (configuration.getKmsClient() == null
+        if (!configuration.isUseDefaultCredentialsProvider() && configuration.getKmsClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
-            throw new IllegalArgumentException("Amazon kms client or accessKey and secretKey must be specified");
+            throw new IllegalArgumentException("useDefaultCredentialsProvider is set to false, Amazon kms client or accessKey and secretKey must be specified");
         }
 
         return endpoint;
diff --git a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
index efbaadb..72a266b 100644
--- a/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
+++ b/components/camel-aws/camel-aws2-kms/src/main/java/org/apache/camel/component/aws2/kms/KMS2Endpoint.java
@@ -23,6 +23,7 @@ import org.apache.camel.Component;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.component.aws2.kms.client.KMS2ClientFactory;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.ScheduledPollEndpoint;
@@ -69,7 +70,9 @@ public class KMS2Endpoint extends ScheduledPollEndpoint {
     public void doStart() throws Exception {
         super.doStart();
 
-        kmsClient = configuration.getKmsClient() != null ? configuration.getKmsClient() : createKMSClient();
+        kmsClient = configuration.getKmsClient() != null
+                ? configuration.getKmsClient()
+                : KMS2ClientFactory.getKmsClient(configuration).getKmsClient();
     }
 
     @Override
@@ -89,50 +92,4 @@ public class KMS2Endpoint extends ScheduledPollEndpoint {
     public KmsClient getKmsClient() {
         return kmsClient;
     }
-
-    KmsClient createKMSClient() {
-        KmsClient client = null;
-        KmsClientBuilder clientBuilder = KmsClient.builder();
-        ProxyConfiguration.Builder proxyConfig = null;
-        ApacheHttpClient.Builder httpClientBuilder = null;
-        boolean isClientConfigFound = false;
-        if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
-            proxyConfig = ProxyConfiguration.builder();
-            URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
-                                           + configuration.getProxyPort());
-            proxyConfig.endpoint(proxyEndpoint);
-            httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
-            isClientConfigFound = true;
-        }
-        if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
-            AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
-            if (isClientConfigFound) {
-                clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
-                        .credentialsProvider(StaticCredentialsProvider.create(cred));
-            } else {
-                clientBuilder = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
-            }
-        } else {
-            if (!isClientConfigFound) {
-                clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
-            }
-        }
-        if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
-            clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
-        }
-        if (configuration.isOverrideEndpoint()) {
-            clientBuilder.endpointOverride(URI.create(configuration.getUriEndpointOverride()));
-        }
-        if (configuration.isTrustAllCertificates()) {
-            SdkHttpClient ahc = ApacheHttpClient.builder().buildWithDefaults(AttributeMap
-                    .builder()
-                    .put(
-                            SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
-                            Boolean.TRUE)
-                    .build());
-            clientBuilder.httpClient(ahc);
-        }
-        client = clientBuilder.build();
-        return client;
-    }
 }