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 9c09d8a8360408d9c5030dcdeb272a79d2b9f8a3 Author: Andrea Cosentino <[email protected]> AuthorDate: Thu May 27 14:39:58 2021 +0200 CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - Translate Component --- .../catalog/docs/aws2-translate-component.adoc | 6 ++-- .../translate/Translate2ComponentConfigurer.java | 6 ++++ .../translate/Translate2EndpointConfigurer.java | 6 ++++ .../translate/Translate2EndpointUriFactory.java | 3 +- .../component/aws2/translate/aws2-translate.json | 2 ++ .../src/main/docs/aws2-translate-component.adoc | 6 ++-- .../aws2/translate/Translate2Component.java | 3 +- .../aws2/translate/Translate2Configuration.java | 4 +-- .../aws2/translate/Translate2Endpoint.java | 15 ++------- .../client/impl/Translate2ClientIAMOptimized.java | 8 ++--- .../client/impl/Translate2ClientStandardImpl.java | 8 ++--- .../dsl/Aws2TranslateComponentBuilderFactory.java | 19 +++++++++++ .../dsl/Translate2EndpointBuilderFactory.java | 37 ++++++++++++++++++++++ .../ROOT/pages/aws2-translate-component.adoc | 6 ++-- 14 files changed, 98 insertions(+), 31 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-translate-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-translate-component.adoc index 1d8ed9a..7de2452 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-translate-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-translate-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Translate component supports 18 options, which are listed below. +The AWS 2 Translate component supports 19 options, which are listed below. @@ -64,6 +64,7 @@ The AWS 2 Translate component supports 18 options, which are listed below. | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -92,7 +93,7 @@ with the following path and query parameters: |=== -=== Query Parameters (16 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -112,6 +113,7 @@ with the following path and query parameters: | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String |=== diff --git a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java index 83781eb..6afb6dc 100644 --- a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java +++ b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2ComponentConfigurer.java @@ -61,6 +61,8 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; case "uriendpointoverride": case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": getOrCreateConfiguration(target).setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true; default: return false; } } @@ -106,6 +108,8 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp case "trustAllCertificates": return boolean.class; case "uriendpointoverride": case "uriEndpointOverride": return java.lang.String.class; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return boolean.class; default: return null; } } @@ -147,6 +151,8 @@ public class Translate2ComponentConfigurer extends PropertyConfigurerSupport imp case "trustAllCertificates": return getOrCreateConfiguration(target).isTrustAllCertificates(); case "uriendpointoverride": case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride(); + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return getOrCreateConfiguration(target).isUseDefaultCredentialsProvider(); default: return null; } } diff --git a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java index 4582dbe..4fab990 100644 --- a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java +++ b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointConfigurer.java @@ -51,6 +51,8 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; case "uriendpointoverride": case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": target.getConfiguration().setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true; default: return false; } } @@ -93,6 +95,8 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl case "trustAllCertificates": return boolean.class; case "uriendpointoverride": case "uriEndpointOverride": return java.lang.String.class; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return boolean.class; default: return null; } } @@ -131,6 +135,8 @@ public class Translate2EndpointConfigurer extends PropertyConfigurerSupport impl case "trustAllCertificates": return target.getConfiguration().isTrustAllCertificates(); case "uriendpointoverride": case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride(); + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return target.getConfiguration().isUseDefaultCredentialsProvider(); default: return null; } } diff --git a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointUriFactory.java b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointUriFactory.java index fc5d7e9..5645d07 100644 --- a/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointUriFactory.java +++ b/components/camel-aws/camel-aws2-translate/src/generated/java/org/apache/camel/component/aws2/translate/Translate2EndpointUriFactory.java @@ -20,12 +20,13 @@ public class Translate2EndpointUriFactory extends org.apache.camel.support.compo private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(17); + Set<String> props = new HashSet<>(18); props.add("autodetectSourceLanguage"); props.add("proxyProtocol"); props.add("targetLanguage"); props.add("secretKey"); props.add("uriEndpointOverride"); + props.add("useDefaultCredentialsProvider"); props.add("label"); props.add("pojoRequest"); props.add("proxyHost"); diff --git a/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json b/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json index 1706c30..547f19d 100644 --- a/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json +++ b/components/camel-aws/camel-aws2-translate/src/generated/resources/org/apache/camel/component/aws2/translate/aws2-translate.json @@ -37,6 +37,7 @@ "translateClient": { "kind": "property", "displayName": "Translate Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translate [...] "trustAllCertificates": { "kind": "property", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" }, "uriEndpointOverride": { "kind": "property", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoi [...] + "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Set whether the Translate client should expect to load crede [...] "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...] "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, "secretKey": { "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } @@ -57,6 +58,7 @@ "translateClient": { "kind": "parameter", "displayName": "Translate Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.translate.TranslateClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS Translat [...] "trustAllCertificates": { "kind": "parameter", "displayName": "Trust All Certificates", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of overriding the endpoint" }, "uriEndpointOverride": { "kind": "parameter", "displayName": "Uri Endpoint Override", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpo [...] + "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Set whether the Translate client should expect to load cred [...] "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, "secretKey": { "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.translate.Translate2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } } diff --git a/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc b/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc index 1d8ed9a..7de2452 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc +++ b/components/camel-aws/camel-aws2-translate/src/main/docs/aws2-translate-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Translate component supports 18 options, which are listed below. +The AWS 2 Translate component supports 19 options, which are listed below. @@ -64,6 +64,7 @@ The AWS 2 Translate component supports 18 options, which are listed below. | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -92,7 +93,7 @@ with the following path and query parameters: |=== -=== Query Parameters (16 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -112,6 +113,7 @@ with the following path and query parameters: | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String |=== diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java index b8eeced..2730071 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java +++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Component.java @@ -56,7 +56,8 @@ public class Translate2Component extends DefaultComponent { setProperties(endpoint, parameters); if (!configuration.isUseDefaultCredentialsProvider() && configuration.getTranslateClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { - throw new IllegalArgumentException("useDefaultCredentialsProvider is set to false, Amazon translate client or accessKey and secretKey must be specified"); + throw new IllegalArgumentException( + "useDefaultCredentialsProvider is set to false, Amazon translate client or accessKey and secretKey must be specified"); } return endpoint; } diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java index a1a6b39..c8c2e11 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java +++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Configuration.java @@ -233,8 +233,8 @@ public class Translate2Configuration implements Cloneable { } /** - * Set whether the Translate client should expect to load credentials through a default credentials provider or to expect - * static credentials to be passed in. + * Set whether the Translate client should expect to load credentials through a default credentials provider or to + * expect static credentials to be passed in. */ public void setUseDefaultCredentialsProvider(Boolean useDefaultCredentialsProvider) { this.useDefaultCredentialsProvider = useDefaultCredentialsProvider; diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java index 65c7bd5..b8cd3ed 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java +++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/Translate2Endpoint.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.aws2.translate; -import java.net.URI; - import org.apache.camel.Category; import org.apache.camel.Component; import org.apache.camel.Consumer; @@ -28,16 +26,7 @@ import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.ScheduledPollEndpoint; import org.apache.camel.util.ObjectHelper; -import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; -import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; -import software.amazon.awssdk.http.SdkHttpClient; -import software.amazon.awssdk.http.SdkHttpConfigurationOption; -import software.amazon.awssdk.http.apache.ApacheHttpClient; -import software.amazon.awssdk.http.apache.ProxyConfiguration; -import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.translate.TranslateClient; -import software.amazon.awssdk.services.translate.TranslateClientBuilder; -import software.amazon.awssdk.utils.AttributeMap; /** * Translate texts using AWS Translate and AWS SDK version 2.x. @@ -72,8 +61,8 @@ public class Translate2Endpoint extends ScheduledPollEndpoint { translateClient = configuration.getTranslateClient() != null - ? configuration.getTranslateClient() - : Translate2ClientFactory.getTranslateClient(configuration).getTranslateClient(); + ? configuration.getTranslateClient() + : Translate2ClientFactory.getTranslateClient(configuration).getTranslateClient(); } @Override diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientIAMOptimized.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientIAMOptimized.java index 9d6367c..00fba99 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientIAMOptimized.java +++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientIAMOptimized.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.aws2.translate.client.impl; +import java.net.URI; + import org.apache.camel.component.aws2.translate.Translate2Configuration; import org.apache.camel.component.aws2.translate.client.Translate2InternalClient; import org.apache.camel.util.ObjectHelper; @@ -30,11 +32,9 @@ import software.amazon.awssdk.services.translate.TranslateClient; import software.amazon.awssdk.services.translate.TranslateClientBuilder; import software.amazon.awssdk.utils.AttributeMap; -import java.net.URI; - /** - * Manage an AWS Translate client for all users to use. This implementation is for remote instances to manage the credentials - * on their own (eliminating credential rotations) + * Manage an AWS Translate client for all users to use. This implementation is for remote instances to manage the + * credentials on their own (eliminating credential rotations) */ public class Translate2ClientIAMOptimized implements Translate2InternalClient { private static final Logger LOG = LoggerFactory.getLogger(Translate2ClientIAMOptimized.class); diff --git a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientStandardImpl.java b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientStandardImpl.java index 2a3d807..29ca9ba 100644 --- a/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientStandardImpl.java +++ b/components/camel-aws/camel-aws2-translate/src/main/java/org/apache/camel/component/aws2/translate/client/impl/Translate2ClientStandardImpl.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.aws2.translate.client.impl; +import java.net.URI; + import org.apache.camel.component.aws2.translate.Translate2Configuration; import org.apache.camel.component.aws2.translate.client.Translate2InternalClient; import org.apache.camel.util.ObjectHelper; @@ -32,11 +34,9 @@ import software.amazon.awssdk.services.translate.TranslateClient; import software.amazon.awssdk.services.translate.TranslateClientBuilder; import software.amazon.awssdk.utils.AttributeMap; -import java.net.URI; - /** - * Manage an AWS Translate client for all users to use. This implementation is for local instances to use a static and solid - * credential set. + * Manage an AWS Translate client for all users to use. This implementation is for local instances to use a static and + * solid credential set. */ public class Translate2ClientStandardImpl implements Translate2InternalClient { private static final Logger LOG = LoggerFactory.getLogger(Translate2ClientStandardImpl.class); diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java index e658aa6..a418ba9 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2TranslateComponentBuilderFactory.java @@ -299,6 +299,24 @@ public interface Aws2TranslateComponentBuilderFactory { return this; } /** + * Set whether the Translate client should expect to load credentials + * through a default credentials provider or to expect static + * credentials to be passed in. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param useDefaultCredentialsProvider the value to set + * @return the dsl builder + */ + default Aws2TranslateComponentBuilder useDefaultCredentialsProvider( + boolean useDefaultCredentialsProvider) { + doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider); + return this; + } + /** * Whether autowiring is enabled. This is used for automatic autowiring * options (the option must be marked as autowired) by looking up in the * registry to find if there is a single instance of matching type, @@ -388,6 +406,7 @@ public interface Aws2TranslateComponentBuilderFactory { case "translateClient": getOrCreateConfiguration((Translate2Component) component).setTranslateClient((software.amazon.awssdk.services.translate.TranslateClient) value); return true; case "trustAllCertificates": getOrCreateConfiguration((Translate2Component) component).setTrustAllCertificates((boolean) value); return true; case "uriEndpointOverride": getOrCreateConfiguration((Translate2Component) component).setUriEndpointOverride((java.lang.String) value); return true; + case "useDefaultCredentialsProvider": getOrCreateConfiguration((Translate2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true; case "autowiredEnabled": ((Translate2Component) component).setAutowiredEnabled((boolean) value); return true; case "accessKey": getOrCreateConfiguration((Translate2Component) component).setAccessKey((java.lang.String) value); return true; case "secretKey": getOrCreateConfiguration((Translate2Component) component).setSecretKey((java.lang.String) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java index 03cebdd..da7707e 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/Translate2EndpointBuilderFactory.java @@ -421,6 +421,43 @@ public interface Translate2EndpointBuilderFactory { return this; } /** + * Set whether the Translate client should expect to load credentials + * through a default credentials provider or to expect static + * credentials to be passed in. + * + * The option is a: <code>boolean</code> type. + * + * Default: false + * Group: producer + * + * @param useDefaultCredentialsProvider the value to set + * @return the dsl builder + */ + default Translate2EndpointBuilder useDefaultCredentialsProvider( + boolean useDefaultCredentialsProvider) { + doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider); + return this; + } + /** + * Set whether the Translate client should expect to load credentials + * through a default credentials provider or to expect static + * credentials to be passed in. + * + * The option will be converted to a <code>boolean</code> + * type. + * + * Default: false + * Group: producer + * + * @param useDefaultCredentialsProvider the value to set + * @return the dsl builder + */ + default Translate2EndpointBuilder useDefaultCredentialsProvider( + String useDefaultCredentialsProvider) { + doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider); + return this; + } + /** * Amazon AWS Access Key. * * The option is a: <code>java.lang.String</code> type. diff --git a/docs/components/modules/ROOT/pages/aws2-translate-component.adoc b/docs/components/modules/ROOT/pages/aws2-translate-component.adoc index 0bb3bfe..4acefe6 100644 --- a/docs/components/modules/ROOT/pages/aws2-translate-component.adoc +++ b/docs/components/modules/ROOT/pages/aws2-translate-component.adoc @@ -44,7 +44,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Translate component supports 18 options, which are listed below. +The AWS 2 Translate component supports 19 options, which are listed below. @@ -66,6 +66,7 @@ The AWS 2 Translate component supports 18 options, which are listed below. | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -94,7 +95,7 @@ with the following path and query parameters: |=== -=== Query Parameters (16 parameters): +=== Query Parameters (17 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -114,6 +115,7 @@ with the following path and query parameters: | *translateClient* (producer) | *Autowired* To use a existing configured AWS Translate as client | | TranslateClient | *trustAllCertificates* (producer) | If we want to trust all certificates in case of overriding the endpoint | false | boolean | *uriEndpointOverride* (producer) | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option | | String +| *useDefaultCredentialsProvider* (producer) | Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String |===
