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 2023/06/09 09:57:58 UTC

[camel] branch main updated (5ed505c278d -> 5833b706b6a)

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 5ed505c278d CAMEL-19426: camel-spring-ws - Fix wrong uri syntax path param
     new c69d7839dae CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new 80246aeb5a2 CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new 1fffcfb6fdc CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new 03cf3173b3c CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new ce52a081231 CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new 044dc6d1ada CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
     new 5833b706b6a CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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:
 .../camel/catalog/components/aws2-lambda.json      | 48 ++++++++++----------
 .../aws2/lambda/Lambda2ComponentConfigurer.java    | 12 +++++
 .../aws2/lambda/Lambda2EndpointConfigurer.java     | 12 +++++
 .../aws2/lambda/Lambda2EndpointUriFactory.java     |  4 +-
 .../camel/component/aws2/lambda/aws2-lambda.json   | 48 ++++++++++----------
 .../src/main/docs/aws2-lambda-component.adoc       |  8 +++-
 .../component/aws2/lambda/Lambda2Component.java    |  6 ++-
 .../aws2/lambda/Lambda2Configuration.java          | 27 ++++++++++++
 .../aws2/lambda/client/Lambda2ClientFactory.java   | 10 ++++-
 ...a => Lambda2ClientIAMProfileOptimizedImpl.java} | 21 +++++----
 .../dsl/Aws2LambdaComponentBuilderFactory.java     | 35 +++++++++++++++
 .../dsl/Lambda2EndpointBuilderFactory.java         | 51 ++++++++++++++++++++++
 12 files changed, 221 insertions(+), 61 deletions(-)
 copy components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/{Lambda2ClientStandardImpl.java => Lambda2ClientIAMProfileOptimizedImpl.java} (82%)


[camel] 03/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 1fffcfb6fdc9d698552ece40070deb302a1a44c9
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:39:50 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../component/aws2/lambda/client/Lambda2ClientFactory.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/Lambda2ClientFactory.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/Lambda2ClientFactory.java
index 84bd6f8d9ae..03569415336 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/Lambda2ClientFactory.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/Lambda2ClientFactory.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.aws2.lambda.client;
 
 import org.apache.camel.component.aws2.lambda.Lambda2Configuration;
+import org.apache.camel.component.aws2.lambda.client.impl.Lambda2ClientIAMProfileOptimizedImpl;
 import org.apache.camel.component.aws2.lambda.client.impl.Lambda2ClientOptimizedImpl;
 import org.apache.camel.component.aws2.lambda.client.impl.Lambda2ClientStandardImpl;
 
@@ -35,7 +36,12 @@ public final class Lambda2ClientFactory {
      * @return               LambdaClient
      */
     public static Lambda2InternalClient getLambdaClient(Lambda2Configuration configuration) {
-        return Boolean.TRUE.equals(configuration.isUseDefaultCredentialsProvider())
-                ? new Lambda2ClientOptimizedImpl(configuration) : new Lambda2ClientStandardImpl(configuration);
+        if (Boolean.TRUE.equals(configuration.isUseDefaultCredentialsProvider())) {
+            return new Lambda2ClientOptimizedImpl(configuration);
+        } else if (Boolean.TRUE.equals(configuration.isUseProfileCredentialsProvider())) {
+            return new Lambda2ClientIAMProfileOptimizedImpl(configuration);
+        } else {
+            return new Lambda2ClientStandardImpl(configuration);
+        }
     }
 }


[camel] 07/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 5833b706b6a9edb2f955bcc6f15b4e1d95d365b2
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:55:26 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc b/components/camel-aws/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc
index f284128e0bb..519d689c662 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc
+++ b/components/camel-aws/camel-aws2-lambda/src/main/docs/aws2-lambda-component.adoc
@@ -58,10 +58,12 @@ the https://aws.amazon.com/lambda/[Amazon Lambda] service.
 
 == Usage
 
-=== Static credentials vs Default Credential Provider
+=== Static credentials, Default Credential Provider and Profile Credentials Provider
 
 You have the possibility of avoiding the usage of explicit static credentials, by specifying the useDefaultCredentialsProvider option and set it to true.
 
+The order of evaluation for Default Credentials Provider is the following:
+
  - Java system properties - aws.accessKeyId and aws.secretKey
  - Environment variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  - Web Identity Token from AWS STS.
@@ -69,6 +71,10 @@ You have the possibility of avoiding the usage of explicit static credentials, b
  - Amazon ECS container credentials - loaded from the Amazon ECS if the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI is set.
  - Amazon EC2 Instance profile credentials. 
 
+You have also the possibility of using Profile Credentials Provider, by specifying the useProfileCredentialsProvider option to true and profileCredentialsName to the profile name.
+
+Only one of static, default and profile credentials could be used at the same time.
+
 For more information about this you can look at https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html[AWS credentials documentation]
 
 // component headers: START


[camel] 05/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 ce52a081231ab89a18da4a79bc5c43bee0083367
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:51:02 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel/catalog/components/aws2-lambda.json      | 48 ++++++++++----------
 .../dsl/Aws2LambdaComponentBuilderFactory.java     | 35 +++++++++++++++
 .../dsl/Lambda2EndpointBuilderFactory.java         | 51 ++++++++++++++++++++++
 3 files changed, 112 insertions(+), 22 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-lambda.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-lambda.json
index 655daf15626..9be0f5a6cda 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-lambda.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-lambda.json
@@ -27,17 +27,19 @@
     "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tagR [...]
     "overrideEndpoint": { "index": 3, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combinat [...]
     "pojoRequest": { "index": 4, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
-    "region": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowercas [...]
-    "trustAllCertificates": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
-    "uriEndpointOverride": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with override [...]
-    "useDefaultCredentialsProvider": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load cr [...]
-    "autowiredEnabled": { "index": 9, "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 t [...]
-    "awsLambdaClient": { "index": 10, "kind": "property", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
-    "proxyHost": { "index": 11, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
-    "proxyPort": { "index": 12, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
-    "proxyProtocol": { "index": 13, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol [...]
-    "accessKey": { "index": 14, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
-    "secretKey": { "index": 15, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
+    "profileCredentialsName": { "index": 5, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profile name" },
+    "region": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowercas [...]
+    "trustAllCertificates": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
+    "uriEndpointOverride": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with override [...]
+    "useDefaultCredentialsProvider": { "index": 9, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load cr [...]
+    "useProfileCredentialsProvider": { "index": 10, "kind": "property", "displayName": "Use Profile 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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "autowiredEnabled": { "index": 11, "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  [...]
+    "awsLambdaClient": { "index": 12, "kind": "property", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
+    "proxyHost": { "index": 13, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
+    "proxyPort": { "index": 14, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
+    "proxyProtocol": { "index": 15, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol [...]
+    "accessKey": { "index": 16, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "index": 17, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
   "headers": {
     "CamelAwsLambdaOperation": { "index": 0, "kind": "header", "displayName": "", "group": "all", "label": "all", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform. Override operation passed as query parameter", "constantName": "org.apache.camel.component.aws2.lambda.Lambda2Constants#OPERATION" },
@@ -76,16 +78,18 @@
     "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tag [...]
     "overrideEndpoint": { "index": 2, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combina [...]
     "pojoRequest": { "index": 3, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
-    "region": { "index": 4, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowerca [...]
-    "trustAllCertificates": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
-    "uriEndpointOverride": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrid [...]
-    "useDefaultCredentialsProvider": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
-    "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
-    "awsLambdaClient": { "index": 9, "kind": "parameter", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
-    "proxyHost": { "index": 10, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
-    "proxyPort": { "index": 11, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
-    "proxyProtocol": { "index": 12, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protoco [...]
-    "accessKey": { "index": 13, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
-    "secretKey": { "index": 14, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
+    "profileCredentialsName": { "index": 4, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profile name" },
+    "region": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowerca [...]
+    "trustAllCertificates": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
+    "uriEndpointOverride": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrid [...]
+    "useDefaultCredentialsProvider": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "useProfileCredentialsProvider": { "index": 9, "kind": "parameter", "displayName": "Use Profile 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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...]
+    "awsLambdaClient": { "index": 11, "kind": "parameter", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aw [...]
+    "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
+    "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
+    "proxyProtocol": { "index": 14, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protoco [...]
+    "accessKey": { "index": 15, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "index": 16, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   }
 }
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java
index 47986d57dd7..4a451846974 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2LambdaComponentBuilderFactory.java
@@ -140,6 +140,22 @@ public interface Aws2LambdaComponentBuilderFactory {
             doSetProperty("pojoRequest", pojoRequest);
             return this;
         }
+        /**
+         * If using a profile credentials provider this parameter will set the
+         * profile name.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param profileCredentialsName the value to set
+         * @return the dsl builder
+         */
+        default Aws2LambdaComponentBuilder profileCredentialsName(
+                java.lang.String profileCredentialsName) {
+            doSetProperty("profileCredentialsName", profileCredentialsName);
+            return this;
+        }
         /**
          * The region in which Lambda client needs to work. When using this
          * parameter, the configuration will expect the lowercase name of the
@@ -208,6 +224,23 @@ public interface Aws2LambdaComponentBuilderFactory {
             doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
             return this;
         }
+        /**
+         * Set whether the Lambda client should expect to load credentials
+         * through a profile credentials provider.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useProfileCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default Aws2LambdaComponentBuilder useProfileCredentialsProvider(
+                boolean useProfileCredentialsProvider) {
+            doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+            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
@@ -347,10 +380,12 @@ public interface Aws2LambdaComponentBuilderFactory {
             case "operation": getOrCreateConfiguration((Lambda2Component) component).setOperation((org.apache.camel.component.aws2.lambda.Lambda2Operations) value); return true;
             case "overrideEndpoint": getOrCreateConfiguration((Lambda2Component) component).setOverrideEndpoint((boolean) value); return true;
             case "pojoRequest": getOrCreateConfiguration((Lambda2Component) component).setPojoRequest((boolean) value); return true;
+            case "profileCredentialsName": getOrCreateConfiguration((Lambda2Component) component).setProfileCredentialsName((java.lang.String) value); return true;
             case "region": getOrCreateConfiguration((Lambda2Component) component).setRegion((java.lang.String) value); return true;
             case "trustAllCertificates": getOrCreateConfiguration((Lambda2Component) component).setTrustAllCertificates((boolean) value); return true;
             case "uriEndpointOverride": getOrCreateConfiguration((Lambda2Component) component).setUriEndpointOverride((java.lang.String) value); return true;
             case "useDefaultCredentialsProvider": getOrCreateConfiguration((Lambda2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true;
+            case "useProfileCredentialsProvider": getOrCreateConfiguration((Lambda2Component) component).setUseProfileCredentialsProvider((boolean) value); return true;
             case "autowiredEnabled": ((Lambda2Component) component).setAutowiredEnabled((boolean) value); return true;
             case "awsLambdaClient": getOrCreateConfiguration((Lambda2Component) component).setAwsLambdaClient((software.amazon.awssdk.services.lambda.LambdaClient) value); return true;
             case "proxyHost": getOrCreateConfiguration((Lambda2Component) component).setProxyHost((java.lang.String) value); return true;
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java
index bcc1c30deb1..e49aba83453 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Lambda2EndpointBuilderFactory.java
@@ -140,6 +140,22 @@ public interface Lambda2EndpointBuilderFactory {
             doSetProperty("pojoRequest", pojoRequest);
             return this;
         }
+        /**
+         * If using a profile credentials provider this parameter will set the
+         * profile name.
+         * 
+         * The option is a: &lt;code&gt;java.lang.String&lt;/code&gt; type.
+         * 
+         * Group: producer
+         * 
+         * @param profileCredentialsName the value to set
+         * @return the dsl builder
+         */
+        default Lambda2EndpointBuilder profileCredentialsName(
+                String profileCredentialsName) {
+            doSetProperty("profileCredentialsName", profileCredentialsName);
+            return this;
+        }
         /**
          * The region in which Lambda client needs to work. When using this
          * parameter, the configuration will expect the lowercase name of the
@@ -245,6 +261,41 @@ public interface Lambda2EndpointBuilderFactory {
             doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider);
             return this;
         }
+        /**
+         * Set whether the Lambda client should expect to load credentials
+         * through a profile credentials provider.
+         * 
+         * The option is a: &lt;code&gt;boolean&lt;/code&gt; type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useProfileCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default Lambda2EndpointBuilder useProfileCredentialsProvider(
+                boolean useProfileCredentialsProvider) {
+            doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+            return this;
+        }
+        /**
+         * Set whether the Lambda client should expect to load credentials
+         * through a profile credentials provider.
+         * 
+         * The option will be converted to a &lt;code&gt;boolean&lt;/code&gt;
+         * type.
+         * 
+         * Default: false
+         * Group: producer
+         * 
+         * @param useProfileCredentialsProvider the value to set
+         * @return the dsl builder
+         */
+        default Lambda2EndpointBuilder useProfileCredentialsProvider(
+                String useProfileCredentialsProvider) {
+            doSetProperty("useProfileCredentialsProvider", useProfileCredentialsProvider);
+            return this;
+        }
         /**
          * To define a proxy host when instantiating the Lambda client.
          * 


[camel] 01/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 c69d7839dae9910eb48b53749dd920124354372f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:09:11 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../component/aws2/lambda/Lambda2Component.java    |  6 +++--
 .../aws2/lambda/Lambda2Configuration.java          | 27 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java
index 8e583ca63b4..e043ce35d9a 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Component.java
@@ -47,10 +47,12 @@ public class Lambda2Component extends DefaultComponent {
         Lambda2Endpoint endpoint = new Lambda2Endpoint(uri, this, configuration);
         setProperties(endpoint, parameters);
         endpoint.setFunction(remaining);
-        if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider()) && configuration.getAwsLambdaClient() == null
+        if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider())
+                && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider())
+                && configuration.getAwsLambdaClient() == null
                 && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException(
-                    "useDefaultCredentialsProvider is set to false, accessKey/secretKey or awsLambdaClient must be specified");
+                    "useDefaultCredentialsProvider is set to false, useProfileCredentialsProvider is set to false, AmazonLambdaClient or accessKey and secretKey must be specified");
         }
 
         return endpoint;
diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java
index 1ecfd3448e8..681ed852aad 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Configuration.java
@@ -53,6 +53,10 @@ public class Lambda2Configuration implements Cloneable {
     private String uriEndpointOverride;
     @UriParam(defaultValue = "false")
     private boolean useDefaultCredentialsProvider;
+    @UriParam(defaultValue = "false")
+    private boolean useProfileCredentialsProvider;
+    @UriParam
+    private String profileCredentialsName;
 
     public LambdaClient getAwsLambdaClient() {
         return awsLambdaClient;
@@ -199,6 +203,29 @@ public class Lambda2Configuration implements Cloneable {
     public Boolean isUseDefaultCredentialsProvider() {
         return useDefaultCredentialsProvider;
     }
+
+    /**
+     * Set whether the Lambda client should expect to load credentials through a profile credentials provider.
+     */
+    public void setUseProfileCredentialsProvider(boolean useProfileCredentialsProvider) {
+        this.useProfileCredentialsProvider = useProfileCredentialsProvider;
+    }
+
+    public String getProfileCredentialsName() {
+        return profileCredentialsName;
+    }
+
+    /**
+     * If using a profile credentials provider this parameter will set the profile name
+     */
+    public void setProfileCredentialsName(String profileCredentialsName) {
+        this.profileCredentialsName = profileCredentialsName;
+    }
+
+    public boolean isUseProfileCredentialsProvider() {
+        return useProfileCredentialsProvider;
+    }
+
     // *************************************************
     //
     // *************************************************


[camel] 02/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 80246aeb5a2a2af1eba933bb22a3903ab4a90a0d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:37:44 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../impl/Lambda2ClientIAMProfileOptimizedImpl.java | 103 +++++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java
new file mode 100644
index 00000000000..958669daacc
--- /dev/null
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java
@@ -0,0 +1,103 @@
+/*
+ * 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.lambda.client.impl;
+
+import org.apache.camel.component.aws2.lambda.Lambda2Configuration;
+import org.apache.camel.component.aws2.lambda.client.Lambda2InternalClient;
+import org.apache.camel.util.ObjectHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
+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.lambda.LambdaClient;
+import software.amazon.awssdk.services.lambda.LambdaClientBuilder;
+import software.amazon.awssdk.utils.AttributeMap;
+
+import java.net.URI;
+
+/**
+ * Manage an AWS Lambda client for all users to use. This implementation is for local instances to use a static and solid
+ * credential set.
+ */
+public class Lambda2ClientIAMProfileOptimizedImpl implements Lambda2InternalClient {
+    private static final Logger LOG = LoggerFactory.getLogger(Lambda2ClientIAMProfileOptimizedImpl.class);
+    private Lambda2Configuration configuration;
+
+    /**
+     * Constructor that uses the config file.
+     */
+    public Lambda2ClientIAMProfileOptimizedImpl(Lambda2Configuration configuration) {
+        LOG.trace("Creating an AWS Lambda manager using profile credentials.");
+        this.configuration = configuration;
+    }
+
+    /**
+     * Getting the Lambda aws client that is used.
+     *
+     * @return Amazon Lambda Client.
+     */
+    @Override
+    public LambdaClient getLambdaClient() {
+        LambdaClient client = null;
+        LambdaClientBuilder clientBuilder = LambdaClient.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.getProfileCredentialsName() != null) {
+            if (isClientConfigFound) {
+                clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
+                        .credentialsProvider(ProfileCredentialsProvider.create(configuration.getProfileCredentialsName()));
+            } else {
+                clientBuilder = clientBuilder
+                        .credentialsProvider(ProfileCredentialsProvider.create(configuration.getProfileCredentialsName()));
+            }
+        } 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] 04/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 03cf3173b3cfbbc73fcd90f94ce2385a1180b58d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:42:44 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../aws2/lambda/Lambda2ComponentConfigurer.java    | 12 ++++++
 .../aws2/lambda/Lambda2EndpointConfigurer.java     | 12 ++++++
 .../aws2/lambda/Lambda2EndpointUriFactory.java     |  4 +-
 .../camel/component/aws2/lambda/aws2-lambda.json   | 48 ++++++++++++----------
 4 files changed, 53 insertions(+), 23 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java
index 7c20f1843d9..608a02e5c03 100644
--- a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2ComponentConfigurer.java
@@ -42,6 +42,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         case "overrideEndpoint": getOrCreateConfiguration(target).setOverrideEndpoint(property(camelContext, boolean.class, value)); return true;
         case "pojorequest":
         case "pojoRequest": getOrCreateConfiguration(target).setPojoRequest(property(camelContext, boolean.class, value)); return true;
+        case "profilecredentialsname":
+        case "profileCredentialsName": getOrCreateConfiguration(target).setProfileCredentialsName(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyhost":
         case "proxyHost": getOrCreateConfiguration(target).setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
@@ -57,6 +59,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         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;
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": getOrCreateConfiguration(target).setUseProfileCredentialsProvider(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -83,6 +87,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         case "overrideEndpoint": return boolean.class;
         case "pojorequest":
         case "pojoRequest": return boolean.class;
+        case "profilecredentialsname":
+        case "profileCredentialsName": return java.lang.String.class;
         case "proxyhost":
         case "proxyHost": return java.lang.String.class;
         case "proxyport":
@@ -98,6 +104,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         case "uriEndpointOverride": return java.lang.String.class;
         case "usedefaultcredentialsprovider":
         case "useDefaultCredentialsProvider": return boolean.class;
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": return boolean.class;
         default: return null;
         }
     }
@@ -120,6 +128,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         case "overrideEndpoint": return getOrCreateConfiguration(target).isOverrideEndpoint();
         case "pojorequest":
         case "pojoRequest": return getOrCreateConfiguration(target).isPojoRequest();
+        case "profilecredentialsname":
+        case "profileCredentialsName": return getOrCreateConfiguration(target).getProfileCredentialsName();
         case "proxyhost":
         case "proxyHost": return getOrCreateConfiguration(target).getProxyHost();
         case "proxyport":
@@ -135,6 +145,8 @@ public class Lambda2ComponentConfigurer extends PropertyConfigurerSupport implem
         case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride();
         case "usedefaultcredentialsprovider":
         case "useDefaultCredentialsProvider": return getOrCreateConfiguration(target).isUseDefaultCredentialsProvider();
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": return getOrCreateConfiguration(target).isUseProfileCredentialsProvider();
         default: return null;
         }
     }
diff --git a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java
index bf02ce269cd..a78ef4d0def 100644
--- a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java
+++ b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointConfigurer.java
@@ -32,6 +32,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         case "overrideEndpoint": target.getConfiguration().setOverrideEndpoint(property(camelContext, boolean.class, value)); return true;
         case "pojorequest":
         case "pojoRequest": target.getConfiguration().setPojoRequest(property(camelContext, boolean.class, value)); return true;
+        case "profilecredentialsname":
+        case "profileCredentialsName": target.getConfiguration().setProfileCredentialsName(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyhost":
         case "proxyHost": target.getConfiguration().setProxyHost(property(camelContext, java.lang.String.class, value)); return true;
         case "proxyport":
@@ -47,6 +49,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         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;
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": target.getConfiguration().setUseProfileCredentialsProvider(property(camelContext, boolean.class, value)); return true;
         default: return false;
         }
     }
@@ -70,6 +74,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         case "overrideEndpoint": return boolean.class;
         case "pojorequest":
         case "pojoRequest": return boolean.class;
+        case "profilecredentialsname":
+        case "profileCredentialsName": return java.lang.String.class;
         case "proxyhost":
         case "proxyHost": return java.lang.String.class;
         case "proxyport":
@@ -85,6 +91,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         case "uriEndpointOverride": return java.lang.String.class;
         case "usedefaultcredentialsprovider":
         case "useDefaultCredentialsProvider": return boolean.class;
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": return boolean.class;
         default: return null;
         }
     }
@@ -104,6 +112,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         case "overrideEndpoint": return target.getConfiguration().isOverrideEndpoint();
         case "pojorequest":
         case "pojoRequest": return target.getConfiguration().isPojoRequest();
+        case "profilecredentialsname":
+        case "profileCredentialsName": return target.getConfiguration().getProfileCredentialsName();
         case "proxyhost":
         case "proxyHost": return target.getConfiguration().getProxyHost();
         case "proxyport":
@@ -119,6 +129,8 @@ public class Lambda2EndpointConfigurer extends PropertyConfigurerSupport impleme
         case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride();
         case "usedefaultcredentialsprovider":
         case "useDefaultCredentialsProvider": return target.getConfiguration().isUseDefaultCredentialsProvider();
+        case "useprofilecredentialsprovider":
+        case "useProfileCredentialsProvider": return target.getConfiguration().isUseProfileCredentialsProvider();
         default: return null;
         }
     }
diff --git a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointUriFactory.java b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointUriFactory.java
index d3427511a2d..f828b9fc689 100644
--- a/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointUriFactory.java
+++ b/components/camel-aws/camel-aws2-lambda/src/generated/java/org/apache/camel/component/aws2/lambda/Lambda2EndpointUriFactory.java
@@ -21,7 +21,7 @@ public class Lambda2EndpointUriFactory extends org.apache.camel.support.componen
     private static final Set<String> SECRET_PROPERTY_NAMES;
     private static final Set<String> MULTI_VALUE_PREFIXES;
     static {
-        Set<String> props = new HashSet<>(15);
+        Set<String> props = new HashSet<>(17);
         props.add("accessKey");
         props.add("awsLambdaClient");
         props.add("function");
@@ -29,6 +29,7 @@ public class Lambda2EndpointUriFactory extends org.apache.camel.support.componen
         props.add("operation");
         props.add("overrideEndpoint");
         props.add("pojoRequest");
+        props.add("profileCredentialsName");
         props.add("proxyHost");
         props.add("proxyPort");
         props.add("proxyProtocol");
@@ -37,6 +38,7 @@ public class Lambda2EndpointUriFactory extends org.apache.camel.support.componen
         props.add("trustAllCertificates");
         props.add("uriEndpointOverride");
         props.add("useDefaultCredentialsProvider");
+        props.add("useProfileCredentialsProvider");
         PROPERTY_NAMES = Collections.unmodifiableSet(props);
         Set<String> secretProps = new HashSet<>(2);
         secretProps.add("accessKey");
diff --git a/components/camel-aws/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json b/components/camel-aws/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json
index 655daf15626..9be0f5a6cda 100644
--- a/components/camel-aws/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json
+++ b/components/camel-aws/camel-aws2-lambda/src/generated/resources/org/apache/camel/component/aws2/lambda/aws2-lambda.json
@@ -27,17 +27,19 @@
     "operation": { "index": 2, "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tagR [...]
     "overrideEndpoint": { "index": 3, "kind": "property", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combinat [...]
     "pojoRequest": { "index": 4, "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
-    "region": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowercas [...]
-    "trustAllCertificates": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
-    "uriEndpointOverride": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with override [...]
-    "useDefaultCredentialsProvider": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load cr [...]
-    "autowiredEnabled": { "index": 9, "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 t [...]
-    "awsLambdaClient": { "index": 10, "kind": "property", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
-    "proxyHost": { "index": 11, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
-    "proxyPort": { "index": 12, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
-    "proxyProtocol": { "index": 13, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol [...]
-    "accessKey": { "index": 14, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
-    "secretKey": { "index": 15, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
+    "profileCredentialsName": { "index": 5, "kind": "property", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profile name" },
+    "region": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowercas [...]
+    "trustAllCertificates": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
+    "uriEndpointOverride": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with override [...]
+    "useDefaultCredentialsProvider": { "index": 9, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load cr [...]
+    "useProfileCredentialsProvider": { "index": 10, "kind": "property", "displayName": "Use Profile 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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "autowiredEnabled": { "index": 11, "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  [...]
+    "awsLambdaClient": { "index": 12, "kind": "property", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
+    "proxyHost": { "index": 13, "kind": "property", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
+    "proxyPort": { "index": 14, "kind": "property", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
+    "proxyProtocol": { "index": 15, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol [...]
+    "accessKey": { "index": 16, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "index": 17, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   },
   "headers": {
     "CamelAwsLambdaOperation": { "index": 0, "kind": "header", "displayName": "", "group": "all", "label": "all", "required": true, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform. Override operation passed as query parameter", "constantName": "org.apache.camel.component.aws2.lambda.Lambda2Constants#OPERATION" },
@@ -76,16 +78,18 @@
     "operation": { "index": 1, "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.lambda.Lambda2Operations", "enum": [ "listFunctions", "getFunction", "createAlias", "deleteAlias", "getAlias", "listAliases", "createFunction", "deleteFunction", "invokeFunction", "updateFunction", "createEventSourceMapping", "deleteEventSourceMapping", "listEventSourceMapping", "listTags", "tag [...]
     "overrideEndpoint": { "index": 2, "kind": "parameter", "displayName": "Override Endpoint", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combina [...]
     "pojoRequest": { "index": 3, "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
-    "region": { "index": 4, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowerca [...]
-    "trustAllCertificates": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
-    "uriEndpointOverride": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrid [...]
-    "useDefaultCredentialsProvider": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
-    "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
-    "awsLambdaClient": { "index": 9, "kind": "parameter", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aws [...]
-    "proxyHost": { "index": 10, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
-    "proxyPort": { "index": 11, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
-    "proxyProtocol": { "index": 12, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protoco [...]
-    "accessKey": { "index": 13, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
-    "secretKey": { "index": 14, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
+    "profileCredentialsName": { "index": 4, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profile name" },
+    "region": { "index": 5, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "The region in which Lambda client needs to work. When using this parameter, the configuration will expect the lowerca [...]
+    "trustAllCertificates": { "index": 6, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" },
+    "uriEndpointOverride": { "index": 7, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrid [...]
+    "useDefaultCredentialsProvider": { "index": 8, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "useProfileCredentialsProvider": { "index": 9, "kind": "parameter", "displayName": "Use Profile 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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Set whether the Lambda client should expect to load c [...]
+    "lazyStartProducer": { "index": 10, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produ [...]
+    "awsLambdaClient": { "index": 11, "kind": "parameter", "displayName": "Aws Lambda Client", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.lambda.LambdaClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To use a existing configured Aw [...]
+    "proxyHost": { "index": 12, "kind": "parameter", "displayName": "Proxy Host", "group": "proxy", "label": "proxy", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the Lambda client" },
+    "proxyPort": { "index": 13, "kind": "parameter", "displayName": "Proxy Port", "group": "proxy", "label": "proxy", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the Lambda client" },
+    "proxyProtocol": { "index": 14, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws2.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "To define a proxy protoco [...]
+    "accessKey": { "index": 15, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" },
+    "secretKey": { "index": 16, "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.lambda.Lambda2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   }
 }


[camel] 06/07: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda

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 044dc6d1ada68388161cbc3aa46a2a5e8306be49
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 9 11:54:19 2023 +0200

    CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS Lambda
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java
index 958669daacc..90e064b415f 100644
--- a/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java
+++ b/components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/client/impl/Lambda2ClientIAMProfileOptimizedImpl.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.aws2.lambda.client.impl;
 
+import java.net.URI;
+
 import org.apache.camel.component.aws2.lambda.Lambda2Configuration;
 import org.apache.camel.component.aws2.lambda.client.Lambda2InternalClient;
 import org.apache.camel.util.ObjectHelper;
@@ -31,11 +33,9 @@ import software.amazon.awssdk.services.lambda.LambdaClient;
 import software.amazon.awssdk.services.lambda.LambdaClientBuilder;
 import software.amazon.awssdk.utils.AttributeMap;
 
-import java.net.URI;
-
 /**
- * Manage an AWS Lambda client for all users to use. This implementation is for local instances to use a static and solid
- * credential set.
+ * Manage an AWS Lambda client for all users to use. This implementation is for local instances to use a static and
+ * solid credential set.
  */
 public class Lambda2ClientIAMProfileOptimizedImpl implements Lambda2InternalClient {
     private static final Logger LOG = LoggerFactory.getLogger(Lambda2ClientIAMProfileOptimizedImpl.class);