You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/04/30 13:42:06 UTC
[camel] 07/10: CAMEL-16465 - Camel-AWS: Add
useDefaultCredentialProvider option to all the components - ECS Component
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 ebafbf6d5d19918aed94b5f25a459a7f94177ece
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Apr 30 15:36:41 2021 +0200
CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - ECS Component
---
.../camel/component/aws2/ecs/ECS2Endpoint.java | 43 ----------------------
1 file changed, 43 deletions(-)
diff --git a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
index 91e7d0b..252a2c5 100644
--- a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
+++ b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
@@ -91,47 +91,4 @@ public class ECS2Endpoint extends ScheduledPollEndpoint {
public EcsClient getEcsClient() {
return ecsClient;
}
-
- EcsClient createECSClient() {
- EcsClient client = null;
- EcsClientBuilder clientBuilder = EcsClient.builder();
- ProxyConfiguration.Builder proxyConfig = null;
- ApacheHttpClient.Builder httpClientBuilder = null;
- boolean isClientConfigFound = false;
- if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) {
- proxyConfig = ProxyConfiguration.builder();
- URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":"
- + configuration.getProxyPort());
- proxyConfig.endpoint(proxyEndpoint);
- httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
- isClientConfigFound = true;
- }
- if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
- AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
- if (isClientConfigFound) {
- clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder)
- .credentialsProvider(StaticCredentialsProvider.create(cred));
- } else {
- clientBuilder = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred));
- }
- } else {
- if (!isClientConfigFound) {
- clientBuilder = clientBuilder.httpClientBuilder(httpClientBuilder);
- }
- }
- if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
- clientBuilder = clientBuilder.region(Region.of(configuration.getRegion()));
- }
- if (configuration.isTrustAllCertificates()) {
- SdkHttpClient ahc = ApacheHttpClient.builder().buildWithDefaults(AttributeMap
- .builder()
- .put(
- SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES,
- Boolean.TRUE)
- .build());
- clientBuilder.httpClient(ahc);
- }
- client = clientBuilder.build();
- return client;
- }
}