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/03/01 14:06:37 UTC

[camel-spring-boot] branch master updated: CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-IAM component

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/master by this push:
     new d79da92  CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-IAM component
d79da92 is described below

commit d79da9249d2746446996c9a14b846aa7ea0da245
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 1 15:06:14 2021 +0100

    CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-IAM component
---
 .../springboot/catalog/components/aws2-iam.json    |  4 ++++
 .../src/main/docs/aws2-iam-starter.adoc            |  4 +++-
 .../iam/springboot/IAM2ComponentConfiguration.java | 26 ++++++++++++++++++++++
 docs/modules/ROOT/pages/aws2-iam-starter.adoc      |  4 +++-
 4 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/aws2-iam.json b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/aws2-iam.json
index 0bfe668..c749c24 100644
--- a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/aws2-iam.json
+++ b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/components/aws2-iam.json
@@ -26,12 +26,14 @@
     "iamClient": { "kind": "property", "displayName": "Iam Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.iam.IamClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS IAM as client" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail during star [...]
     "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.iam.IAM2Operations", "enum": [ "listAccessKeys", "createUser", "deleteUser", "getUser", "listUsers", "createAccessKey", "deleteAccessKey", "updateAccessKey", "createGroup", "deleteGroup", "listGroups", "addUserToGroup", "removeUserFromGroup" ], "deprecated": false, "autowired": false, "secret": false, "confi [...]
+    "overrideEndpoint": { "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpoi [...]
     "pojoRequest": { "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the IAM client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the IAM client" },
     "proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol", "group": "producer", "label": "", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating t [...]
     "region": { "kind": "property", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "aws-global", "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "The region in which IAM client needs to work. When using this parameter, the configuration will expect the [...]
     "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.iam.IAM2Configuration", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "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.iam.IAM2Configuration", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
@@ -41,12 +43,14 @@
     "iamClient": { "kind": "parameter", "displayName": "Iam Client", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "software.amazon.awssdk.services.iam.IamClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To use a existing configured AWS IAM as client" },
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "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 producer may otherwise fail during sta [...]
     "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.iam.IAM2Operations", "enum": [ "listAccessKeys", "createUser", "deleteUser", "getUser", "listUsers", "createAccessKey", "deleteAccessKey", "updateAccessKey", "createGroup", "deleteGroup", "listGroups", "addUserToGroup", "removeUserFromGroup" ], "deprecated": false, "autowired": false, "secret": false, "conf [...]
+    "overrideEndpoint": { "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpo [...]
     "pojoRequest": { "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "If we want to use a POJO request as body or not" },
     "proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the IAM client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the IAM client" },
     "proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol", "group": "producer", "label": "", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "To define a proxy protocol when instantiating  [...]
     "region": { "kind": "parameter", "displayName": "Region", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "aws-global", "configurationClass": "org.apache.camel.component.aws2.iam.IAM2Configuration", "configurationField": "configuration", "description": "The region in which IAM client needs to work. When using this parameter, the configuration will expect th [...]
     "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.iam.IAM2Configuration", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option" },
     "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.iam.IAM2Configuration", "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.iam.IAM2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }
   }
diff --git a/components-starter/camel-aws2-iam-starter/src/main/docs/aws2-iam-starter.adoc b/components-starter/camel-aws2-iam-starter/src/main/docs/aws2-iam-starter.adoc
index 5d7d02e..8b17a86 100644
--- a/components-starter/camel-aws2-iam-starter/src/main/docs/aws2-iam-starter.adoc
+++ b/components-starter/camel-aws2-iam-starter/src/main/docs/aws2-iam-starter.adoc
@@ -17,7 +17,7 @@ When using aws2-iam with Spring Boot make sure to use the following Maven depend
 ----
 
 
-The component supports 14 options, which are listed below.
+The component supports 16 options, which are listed below.
 
 
 
@@ -31,6 +31,7 @@ The component supports 14 options, which are listed below.
 | *camel.component.aws2-iam.iam-client* | To use a existing configured AWS IAM as client. The option is a software.amazon.awssdk.services.iam.IamClient type. |  | IamClient
 | *camel.component.aws2-iam.lazy-start-producer* | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed t [...]
 | *camel.component.aws2-iam.operation* | The operation to perform. You can configure a default operation on the component level, or the operation as part of the endpoint, or via a message header with the key CamelAwsIAMOperation. |  | IAM2Operations
+| *camel.component.aws2-iam.override-endpoint* | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | Boolean
 | *camel.component.aws2-iam.pojo-request* | If we want to use a POJO request as body or not | false | Boolean
 | *camel.component.aws2-iam.proxy-host* | To define a proxy host when instantiating the IAM client |  | String
 | *camel.component.aws2-iam.proxy-port* | To define a proxy port when instantiating the IAM client |  | Integer
@@ -38,5 +39,6 @@ The component supports 14 options, which are listed below.
 | *camel.component.aws2-iam.region* | The region in which IAM client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | aws-global | String
 | *camel.component.aws2-iam.secret-key* | Amazon AWS Secret Key |  | String
 | *camel.component.aws2-iam.trust-all-certificates* | If we want to trust all certificates in case of overriding the endpoint | false | Boolean
+| *camel.component.aws2-iam.uri-endpoint-override* | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
 |===
 // spring-boot-auto-configure options: END
diff --git a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConfiguration.java b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConfiguration.java
index dff2a50..5e15c0d 100644
--- a/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConfiguration.java
+++ b/components-starter/camel-aws2-iam-starter/src/main/java/org/apache/camel/component/aws2/iam/springboot/IAM2ComponentConfiguration.java
@@ -69,6 +69,11 @@ public class IAM2ComponentConfiguration
      */
     private IAM2Operations operation;
     /**
+     * Set the need for overidding the endpoint. This option needs to be used in
+     * combination with uriEndpointOverride option
+     */
+    private Boolean overrideEndpoint = false;
+    /**
      * If we want to use a POJO request as body or not
      */
     private Boolean pojoRequest = false;
@@ -95,6 +100,11 @@ public class IAM2ComponentConfiguration
      */
     private Boolean trustAllCertificates = false;
     /**
+     * Set the overriding uri endpoint. This option needs to be used in
+     * combination with overrideEndpoint option
+     */
+    private String uriEndpointOverride;
+    /**
      * 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
@@ -144,6 +154,14 @@ public class IAM2ComponentConfiguration
         this.operation = operation;
     }
 
+    public Boolean getOverrideEndpoint() {
+        return overrideEndpoint;
+    }
+
+    public void setOverrideEndpoint(Boolean overrideEndpoint) {
+        this.overrideEndpoint = overrideEndpoint;
+    }
+
     public Boolean getPojoRequest() {
         return pojoRequest;
     }
@@ -192,6 +210,14 @@ public class IAM2ComponentConfiguration
         this.trustAllCertificates = trustAllCertificates;
     }
 
+    public String getUriEndpointOverride() {
+        return uriEndpointOverride;
+    }
+
+    public void setUriEndpointOverride(String uriEndpointOverride) {
+        this.uriEndpointOverride = uriEndpointOverride;
+    }
+
     public Boolean getAutowiredEnabled() {
         return autowiredEnabled;
     }
diff --git a/docs/modules/ROOT/pages/aws2-iam-starter.adoc b/docs/modules/ROOT/pages/aws2-iam-starter.adoc
index 5d7d02e..8b17a86 100644
--- a/docs/modules/ROOT/pages/aws2-iam-starter.adoc
+++ b/docs/modules/ROOT/pages/aws2-iam-starter.adoc
@@ -17,7 +17,7 @@ When using aws2-iam with Spring Boot make sure to use the following Maven depend
 ----
 
 
-The component supports 14 options, which are listed below.
+The component supports 16 options, which are listed below.
 
 
 
@@ -31,6 +31,7 @@ The component supports 14 options, which are listed below.
 | *camel.component.aws2-iam.iam-client* | To use a existing configured AWS IAM as client. The option is a software.amazon.awssdk.services.iam.IamClient type. |  | IamClient
 | *camel.component.aws2-iam.lazy-start-producer* | 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 producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed t [...]
 | *camel.component.aws2-iam.operation* | The operation to perform. You can configure a default operation on the component level, or the operation as part of the endpoint, or via a message header with the key CamelAwsIAMOperation. |  | IAM2Operations
+| *camel.component.aws2-iam.override-endpoint* | Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option | false | Boolean
 | *camel.component.aws2-iam.pojo-request* | If we want to use a POJO request as body or not | false | Boolean
 | *camel.component.aws2-iam.proxy-host* | To define a proxy host when instantiating the IAM client |  | String
 | *camel.component.aws2-iam.proxy-port* | To define a proxy port when instantiating the IAM client |  | Integer
@@ -38,5 +39,6 @@ The component supports 14 options, which are listed below.
 | *camel.component.aws2-iam.region* | The region in which IAM client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU_WEST_1.id() | aws-global | String
 | *camel.component.aws2-iam.secret-key* | Amazon AWS Secret Key |  | String
 | *camel.component.aws2-iam.trust-all-certificates* | If we want to trust all certificates in case of overriding the endpoint | false | Boolean
+| *camel.component.aws2-iam.uri-endpoint-override* | Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option |  | String
 |===
 // spring-boot-auto-configure options: END