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/14 09:58:09 UTC
[camel] 04/06: CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS ECS
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 ada4b045ad70c03fb2aae65aae1d12ab938fe299
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Jun 14 11:21:58 2023 +0200
CAMEL-19159 - Camel-AWS: Support Profile Credential provider as configuration - AWS ECS
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java | 3 ++-
.../java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java | 1 -
.../aws2/ecs/client/impl/ECS2ClientIAMProfileOptimizedImpl.java | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
index f8948213f4b..ee47c22dbd4 100644
--- a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
+++ b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Component.java
@@ -45,7 +45,8 @@ public class ECS2Component extends DefaultComponent {
ECS2Configuration configuration = this.configuration != null ? this.configuration.copy() : new ECS2Configuration();
ECS2Endpoint endpoint = new ECS2Endpoint(uri, this, configuration);
setProperties(endpoint, parameters);
- if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider()) && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider()) && configuration.getEcsClient() == null
+ if (Boolean.FALSE.equals(configuration.isUseDefaultCredentialsProvider())
+ && Boolean.FALSE.equals(configuration.isUseProfileCredentialsProvider()) && configuration.getEcsClient() == null
&& (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
throw new IllegalArgumentException(
"useDefaultCredentialsProvider is set to false, useProfileCredentialsProvider is set to false, Amazon ecs client or accessKey and secretKey must be specified");
diff --git a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
index 52bfb6f7fa3..98ae3050293 100644
--- a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
+++ b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Configuration.java
@@ -211,7 +211,6 @@ public class ECS2Configuration implements Cloneable {
return useDefaultCredentialsProvider;
}
-
public boolean isUseProfileCredentialsProvider() {
return useProfileCredentialsProvider;
}
diff --git a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/client/impl/ECS2ClientIAMProfileOptimizedImpl.java b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/client/impl/ECS2ClientIAMProfileOptimizedImpl.java
index e8c543bb27f..8b129a0460e 100644
--- a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/client/impl/ECS2ClientIAMProfileOptimizedImpl.java
+++ b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/client/impl/ECS2ClientIAMProfileOptimizedImpl.java
@@ -16,6 +16,8 @@
*/
package org.apache.camel.component.aws2.ecs.client.impl;
+import java.net.URI;
+
import org.apache.camel.component.aws2.ecs.ECS2Configuration;
import org.apache.camel.component.aws2.ecs.client.ECS2InternalClient;
import org.apache.camel.util.ObjectHelper;
@@ -31,8 +33,6 @@ import software.amazon.awssdk.services.ecs.EcsClient;
import software.amazon.awssdk.services.ecs.EcsClientBuilder;
import software.amazon.awssdk.utils.AttributeMap;
-import java.net.URI;
-
/**
* Manage an AWS ECS client for all users to use (enabling temporary creds). This implementation is for remote instances
* to manage the credentials on their own (eliminating credential rotations)