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 78de41ecb36e039dba734507b6de7ad072eb23dc Author: Andrea Cosentino <[email protected]> AuthorDate: Thu May 27 10:56:12 2021 +0200 CAMEL-16465 - Camel-AWS: Add useDefaultCredentialProvider option to all the components - STS Component --- .../camel/catalog/docs/aws2-sts-component.adoc | 6 ++-- .../aws2/sts/STS2ComponentConfigurer.java | 6 ++++ .../component/aws2/sts/STS2EndpointConfigurer.java | 6 ++++ .../component/aws2/sts/STS2EndpointUriFactory.java | 3 +- .../apache/camel/component/aws2/sts/aws2-sts.json | 2 ++ .../src/main/docs/aws2-sts-component.adoc | 6 ++-- .../camel/component/aws2/sts/STS2Component.java | 3 +- .../camel/component/aws2/sts/STS2Endpoint.java | 11 ------- .../sts/client/impl/STS2ClientIAMOptimized.java | 4 +-- .../sts/client/impl/STS2ClientStandardImpl.java | 7 ++-- .../dsl/Aws2StsComponentBuilderFactory.java | 19 +++++++++++ .../endpoint/dsl/STS2EndpointBuilderFactory.java | 37 ++++++++++++++++++++++ .../modules/ROOT/pages/aws2-sts-component.adoc | 6 ++-- 13 files changed, 91 insertions(+), 25 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sts-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sts-component.adoc index 1a5558d..1536d06 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sts-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/aws2-sts-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Security Token Service (STS) component supports 15 options, which are listed below. +The AWS 2 Security Token Service (STS) component supports 16 options, which are listed below. @@ -61,6 +61,7 @@ The AWS 2 Security Token Service (STS) component supports 15 options, which are | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -89,7 +90,7 @@ with the following path and query parameters: |=== -=== Query Parameters (13 parameters): +=== Query Parameters (14 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -106,6 +107,7 @@ with the following path and query parameters: | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS 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-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2ComponentConfigurer.java b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2ComponentConfigurer.java index d96850d..16013fb 100644 --- a/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2ComponentConfigurer.java +++ b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2ComponentConfigurer.java @@ -55,6 +55,8 @@ public class STS2ComponentConfigurer extends PropertyConfigurerSupport implement case "trustAllCertificates": getOrCreateConfiguration(target).setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; case "uriendpointoverride": case "uriEndpointOverride": getOrCreateConfiguration(target).setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": getOrCreateConfiguration(target).setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true; default: return false; } } @@ -94,6 +96,8 @@ public class STS2ComponentConfigurer extends PropertyConfigurerSupport implement case "trustAllCertificates": return boolean.class; case "uriendpointoverride": case "uriEndpointOverride": return java.lang.String.class; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return boolean.class; default: return null; } } @@ -129,6 +133,8 @@ public class STS2ComponentConfigurer extends PropertyConfigurerSupport implement case "trustAllCertificates": return getOrCreateConfiguration(target).isTrustAllCertificates(); case "uriendpointoverride": case "uriEndpointOverride": return getOrCreateConfiguration(target).getUriEndpointOverride(); + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return getOrCreateConfiguration(target).isUseDefaultCredentialsProvider(); default: return null; } } diff --git a/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointConfigurer.java b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointConfigurer.java index c2ec62a..c0bac88 100644 --- a/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointConfigurer.java +++ b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointConfigurer.java @@ -45,6 +45,8 @@ public class STS2EndpointConfigurer extends PropertyConfigurerSupport implements case "trustAllCertificates": target.getConfiguration().setTrustAllCertificates(property(camelContext, boolean.class, value)); return true; case "uriendpointoverride": case "uriEndpointOverride": target.getConfiguration().setUriEndpointOverride(property(camelContext, java.lang.String.class, value)); return true; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": target.getConfiguration().setUseDefaultCredentialsProvider(property(camelContext, boolean.class, value)); return true; default: return false; } } @@ -81,6 +83,8 @@ public class STS2EndpointConfigurer extends PropertyConfigurerSupport implements case "trustAllCertificates": return boolean.class; case "uriendpointoverride": case "uriEndpointOverride": return java.lang.String.class; + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return boolean.class; default: return null; } } @@ -113,6 +117,8 @@ public class STS2EndpointConfigurer extends PropertyConfigurerSupport implements case "trustAllCertificates": return target.getConfiguration().isTrustAllCertificates(); case "uriendpointoverride": case "uriEndpointOverride": return target.getConfiguration().getUriEndpointOverride(); + case "usedefaultcredentialsprovider": + case "useDefaultCredentialsProvider": return target.getConfiguration().isUseDefaultCredentialsProvider(); default: return null; } } diff --git a/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointUriFactory.java b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointUriFactory.java index 838cb38..e2d7089 100644 --- a/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointUriFactory.java +++ b/components/camel-aws/camel-aws2-sts/src/generated/java/org/apache/camel/component/aws2/sts/STS2EndpointUriFactory.java @@ -20,10 +20,11 @@ public class STS2EndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(14); + Set<String> props = new HashSet<>(15); props.add("proxyProtocol"); props.add("secretKey"); props.add("uriEndpointOverride"); + props.add("useDefaultCredentialsProvider"); props.add("label"); props.add("pojoRequest"); props.add("proxyHost"); diff --git a/components/camel-aws/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json b/components/camel-aws/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json index 728fdf4..b936540 100644 --- a/components/camel-aws/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json +++ b/components/camel-aws/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json @@ -34,6 +34,7 @@ "stsClient": { "kind": "property", "displayName": "Sts Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.sts.StsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS STS as client" }, "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.sts.STS2Configuration", "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.sts.STS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" }, + "useDefaultCredentialsProvider": { "kind": "property", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "Set whether the STS client should expect to load credentials through a d [...] "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...] "accessKey": { "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "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.sts.STS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } @@ -51,6 +52,7 @@ "stsClient": { "kind": "parameter", "displayName": "Sts Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.sts.StsClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS STS as client" }, "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.sts.STS2Configuration", "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.sts.STS2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" }, + "useDefaultCredentialsProvider": { "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "Set whether the STS client should expect to load credentials through a [...] "accessKey": { "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "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.sts.STS2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" } } diff --git a/components/camel-aws/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc b/components/camel-aws/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc index 1a5558d..1536d06 100644 --- a/components/camel-aws/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc +++ b/components/camel-aws/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc @@ -42,7 +42,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Security Token Service (STS) component supports 15 options, which are listed below. +The AWS 2 Security Token Service (STS) component supports 16 options, which are listed below. @@ -61,6 +61,7 @@ The AWS 2 Security Token Service (STS) component supports 15 options, which are | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -89,7 +90,7 @@ with the following path and query parameters: |=== -=== Query Parameters (13 parameters): +=== Query Parameters (14 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -106,6 +107,7 @@ with the following path and query parameters: | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS 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-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Component.java b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Component.java index b9f1f42..3e7acf8 100644 --- a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Component.java +++ b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Component.java @@ -54,7 +54,8 @@ public class STS2Component extends DefaultComponent { setProperties(endpoint, parameters); if (!configuration.isUseDefaultCredentialsProvider() && configuration.getStsClient() == null && (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) { - throw new IllegalArgumentException("useDefaultCredentialsProvider is set to false, Amazon STS client or accessKey and secretKey must be specified"); + throw new IllegalArgumentException( + "useDefaultCredentialsProvider is set to false, Amazon STS client or accessKey and secretKey must be specified"); } return endpoint; diff --git a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Endpoint.java b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Endpoint.java index fdab986..b31754f 100644 --- a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Endpoint.java +++ b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Endpoint.java @@ -16,8 +16,6 @@ */ package org.apache.camel.component.aws2.sts; -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.DefaultEndpoint; 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.sts.StsClient; -import software.amazon.awssdk.services.sts.StsClientBuilder; -import software.amazon.awssdk.utils.AttributeMap; /** * Manage AWS STS cluster instances using AWS SDK version 2.x. diff --git a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientIAMOptimized.java b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientIAMOptimized.java index e52ec22..05741fc 100644 --- a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientIAMOptimized.java +++ b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientIAMOptimized.java @@ -16,6 +16,8 @@ */ package org.apache.camel.component.aws2.sts.client.impl; +import java.net.URI; + import org.apache.camel.component.aws2.sts.STS2Configuration; import org.apache.camel.component.aws2.sts.client.STS2InternalClient; import org.apache.camel.util.ObjectHelper; @@ -30,8 +32,6 @@ import software.amazon.awssdk.services.sts.StsClient; import software.amazon.awssdk.services.sts.StsClientBuilder; import software.amazon.awssdk.utils.AttributeMap; -import java.net.URI; - /** * Manage an AWS STS client for all users to use. This implementation is for remote instances to manage the credentials * on their own (eliminating credential rotations) diff --git a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientStandardImpl.java b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientStandardImpl.java index b9c4a5d..e89f3fb 100644 --- a/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientStandardImpl.java +++ b/components/camel-aws/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/client/impl/STS2ClientStandardImpl.java @@ -16,9 +16,10 @@ */ package org.apache.camel.component.aws2.sts.client.impl; +import java.net.URI; + import org.apache.camel.component.aws2.sts.STS2Configuration; import org.apache.camel.component.aws2.sts.client.STS2InternalClient; -import org.apache.camel.util.FileUtil; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,8 +34,6 @@ import software.amazon.awssdk.services.sts.StsClient; import software.amazon.awssdk.services.sts.StsClientBuilder; import software.amazon.awssdk.utils.AttributeMap; -import java.net.URI; - /** * Manage an AWS STS client for all users to use. This implementation is for local instances to use a static and solid * credential set. @@ -66,7 +65,7 @@ public class STS2ClientStandardImpl implements STS2InternalClient { if (ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) { proxyConfig = ProxyConfiguration.builder(); URI proxyEndpoint = URI.create(configuration.getProxyProtocol() + "://" + configuration.getProxyHost() + ":" - + configuration.getProxyPort()); + + configuration.getProxyPort()); proxyConfig.endpoint(proxyEndpoint); httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build()); isClientConfigFound = true; diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2StsComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2StsComponentBuilderFactory.java index 945f547..7b76a2d 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2StsComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Aws2StsComponentBuilderFactory.java @@ -250,6 +250,24 @@ public interface Aws2StsComponentBuilderFactory { return this; } /** + * Set whether the STS 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 Aws2StsComponentBuilder 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, @@ -334,6 +352,7 @@ public interface Aws2StsComponentBuilderFactory { case "stsClient": getOrCreateConfiguration((STS2Component) component).setStsClient((software.amazon.awssdk.services.sts.StsClient) value); return true; case "trustAllCertificates": getOrCreateConfiguration((STS2Component) component).setTrustAllCertificates((boolean) value); return true; case "uriEndpointOverride": getOrCreateConfiguration((STS2Component) component).setUriEndpointOverride((java.lang.String) value); return true; + case "useDefaultCredentialsProvider": getOrCreateConfiguration((STS2Component) component).setUseDefaultCredentialsProvider((boolean) value); return true; case "autowiredEnabled": ((STS2Component) component).setAutowiredEnabled((boolean) value); return true; case "accessKey": getOrCreateConfiguration((STS2Component) component).setAccessKey((java.lang.String) value); return true; case "secretKey": getOrCreateConfiguration((STS2Component) component).setSecretKey((java.lang.String) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/STS2EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/STS2EndpointBuilderFactory.java index 26cf186..df87917 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/STS2EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/STS2EndpointBuilderFactory.java @@ -355,6 +355,43 @@ public interface STS2EndpointBuilderFactory { return this; } /** + * Set whether the STS 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 STS2EndpointBuilder useDefaultCredentialsProvider( + boolean useDefaultCredentialsProvider) { + doSetProperty("useDefaultCredentialsProvider", useDefaultCredentialsProvider); + return this; + } + /** + * Set whether the STS 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 STS2EndpointBuilder 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-sts-component.adoc b/docs/components/modules/ROOT/pages/aws2-sts-component.adoc index fa51b65..ef591c2 100644 --- a/docs/components/modules/ROOT/pages/aws2-sts-component.adoc +++ b/docs/components/modules/ROOT/pages/aws2-sts-component.adoc @@ -44,7 +44,7 @@ You can append query options to the URI in the following format, // component options: START -The AWS 2 Security Token Service (STS) component supports 15 options, which are listed below. +The AWS 2 Security Token Service (STS) component supports 16 options, which are listed below. @@ -63,6 +63,7 @@ The AWS 2 Security Token Service (STS) component supports 15 options, which are | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in. | false | boolean | *autowiredEnabled* (advanced) | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | boolean | *accessKey* (security) | Amazon AWS Access Key | | String | *secretKey* (security) | Amazon AWS Secret Key | | String @@ -91,7 +92,7 @@ with the following path and query parameters: |=== -=== Query Parameters (13 parameters): +=== Query Parameters (14 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -108,6 +109,7 @@ with the following path and query parameters: | *stsClient* (producer) | *Autowired* To use a existing configured AWS STS as client | | StsClient | *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 STS 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 |===
