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 2020/08/27 06:57:13 UTC

[camel] branch master updated (ab278c2 -> 748dba1)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from ab278c2  Removed Jenkinsifle for full pipeline: it takes too much time and it's not reliable
     new 53f11ff  CAMEL-15374 - Camel-AWS2-STS: Add more operation to the producer, getFederationToken
     new 77939a9  CAMEL-15374 - Regen and fixed CS
     new 5bcd48c  CAMEL-15374 - Added Spring test for getFederationToken
     new 6039228  CAMEL-15374 - Improved tests
     new 7d9e206  CAMEL-15374 - Improved misleading error log
     new 748dba1  CAMEL-15374 - Added getFederationToken docs and example

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/component/aws2/sts/aws2-sts.json  |  4 +--
 .../src/main/docs/aws2-sts-component.adoc          | 14 ++++++--
 .../camel/component/aws2/sts/STS2Constants.java    |  1 +
 .../camel/component/aws2/sts/STS2Operations.java   |  3 +-
 .../camel/component/aws2/sts/STS2Producer.java     | 40 ++++++++++++++++++++++
 .../component/aws2/sts/AmazonSTSClientMock.java    |  9 +++++
 .../component/aws2/sts/STS2ProducerSpringTest.java | 18 ++++++++++
 .../camel/component/aws2/sts/STS2ProducerTest.java | 21 ++++++++++++
 .../aws2/sts/STSComponentSpringTest-context.xml    |  5 +++
 .../endpoint/dsl/STS2EndpointBuilderFactory.java   |  3 +-
 10 files changed, 112 insertions(+), 6 deletions(-)


[camel] 04/06: CAMEL-15374 - Improved tests

Posted by ac...@apache.org.
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.git

commit 603922847800b97a1c46314a81f3b920c82f66ac
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:52:43 2020 +0200

    CAMEL-15374 - Improved tests
---
 .../org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java    | 3 ++-
 .../java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
index c5b688e..43d91a4 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
@@ -69,7 +69,7 @@ public class STS2ProducerSpringTest extends CamelSpringTestSupport {
         GetSessionTokenResponse resultGet = (GetSessionTokenResponse) exchange.getIn().getBody();
         assertEquals("xxx", resultGet.credentials().accessKeyId());
     }
-    
+
     public void stsGetFederationTokenTest() throws Exception {
 
         mock.expectedMessageCount(1);
@@ -77,6 +77,7 @@ public class STS2ProducerSpringTest extends CamelSpringTestSupport {
             @Override
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setHeader(STS2Constants.OPERATION, STS2Operations.getFederationToken);
+                exchange.getIn().setHeader(STS2Constants.FEDERATED_NAME, "federation-account");
             }
         });
 
diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
index fe0489c..eed12e7 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
@@ -82,6 +82,7 @@ public class STS2ProducerTest extends CamelTestSupport {
             @Override
             public void process(Exchange exchange) throws Exception {
                 exchange.getIn().setHeader(STS2Constants.OPERATION, STS2Operations.getFederationToken);
+                exchange.getIn().setHeader(STS2Constants.FEDERATED_NAME, "federation-account");
             }
         });
 


[camel] 06/06: CAMEL-15374 - Added getFederationToken docs and example

Posted by ac...@apache.org.
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.git

commit 748dba1af70f1858f4c159161ba888239124faf0
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:54:39 2020 +0200

    CAMEL-15374 - Added getFederationToken docs and example
---
 .../camel-aws2-sts/src/main/docs/aws2-sts-component.adoc       | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc b/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
index 872c8d3..715e0d4 100644
--- a/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
+++ b/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
@@ -131,6 +131,7 @@ Camel-AWS STS component provides the following operation on the producer side:
 
 - assumeRole
 - getSessionToken
+- getFedeationToken
 
 == Producer Examples
 
@@ -152,6 +153,15 @@ from("direct:getSessionToken")
     .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=getSessionToken")
 --------------------------------------------------------------------------------
 
+- getFederationToken: this operation will return a temporary federation token
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:getFederationToken")
+    .setHeader(STS2Constants.FEDERATED_NAME, constant("federation-account"))
+    .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=getSessionToken")
+--------------------------------------------------------------------------------
+
 == Automatic detection of StsClient client in registry
 
 The component is capable of detecting the presence of an StsClient bean into the registry.


[camel] 03/06: CAMEL-15374 - Added Spring test for getFederationToken

Posted by ac...@apache.org.
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.git

commit 5bcd48ceef5ceb8c83253054fff400932121d108
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:41:17 2020 +0200

    CAMEL-15374 - Added Spring test for getFederationToken
---
 .../component/aws2/sts/STS2ProducerSpringTest.java      | 17 +++++++++++++++++
 .../aws2/sts/STSComponentSpringTest-context.xml         |  5 +++++
 2 files changed, 22 insertions(+)

diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
index 53d303a..c5b688e 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerSpringTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
 import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenResponse;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenResponse;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -68,6 +69,22 @@ public class STS2ProducerSpringTest extends CamelSpringTestSupport {
         GetSessionTokenResponse resultGet = (GetSessionTokenResponse) exchange.getIn().getBody();
         assertEquals("xxx", resultGet.credentials().accessKeyId());
     }
+    
+    public void stsGetFederationTokenTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:getFederationToken", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(STS2Constants.OPERATION, STS2Operations.getFederationToken);
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        GetFederationTokenResponse resultGet = (GetFederationTokenResponse) exchange.getIn().getBody();
+        assertEquals("xxx", resultGet.credentials().accessKeyId());
+    }
 
     @Override
     protected ClassPathXmlApplicationContext createApplicationContext() {
diff --git a/components/camel-aws2-sts/src/test/resources/org/apache/camel/component/aws2/sts/STSComponentSpringTest-context.xml b/components/camel-aws2-sts/src/test/resources/org/apache/camel/component/aws2/sts/STSComponentSpringTest-context.xml
index 5414028..9b0e2d9 100644
--- a/components/camel-aws2-sts/src/test/resources/org/apache/camel/component/aws2/sts/STSComponentSpringTest-context.xml
+++ b/components/camel-aws2-sts/src/test/resources/org/apache/camel/component/aws2/sts/STSComponentSpringTest-context.xml
@@ -34,6 +34,11 @@
             <to uri="aws2-sts://test?stsClient=#amazonStsClient&amp;operation=getSessionToken"/>
             <to uri="mock:result"/>
         </route>
+        <route>
+            <from uri="direct:getFederationToken"/>
+            <to uri="aws2-sts://test?stsClient=#amazonStsClient&amp;operation=getFederationToken"/>
+            <to uri="mock:result"/>
+        </route>
     </camelContext>
 
     <bean id="amazonStsClient" class="org.apache.camel.component.aws2.sts.AmazonSTSClientMock"/>


[camel] 05/06: CAMEL-15374 - Improved misleading error log

Posted by ac...@apache.org.
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.git

commit 7d9e206d070df08a20b9bab24b51f6e5e1a0bc7f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:53:06 2020 +0200

    CAMEL-15374 - Improved misleading error log
---
 .../src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
index 8f2b783..5254d1c 100644
--- a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
+++ b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
@@ -182,7 +182,7 @@ public class STS2Producer extends DefaultProducer {
                 String federatedName = exchange.getIn().getHeader(STS2Constants.FEDERATED_NAME, String.class);
                 builder.name(federatedName);
             } else {
-                throw new IllegalArgumentException("Role ARN needs to be specified for assumeRole operation");
+                throw new IllegalArgumentException("Federated name needs to be specified for assumeRole operation");
             }
             try {
                 result = stsClient.getFederationToken(builder.build());


[camel] 01/06: CAMEL-15374 - Camel-AWS2-STS: Add more operation to the producer, getFederationToken

Posted by ac...@apache.org.
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.git

commit 53f11ffd97bb605b6f8bf3be9734f39420e6762f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:39:52 2020 +0200

    CAMEL-15374 - Camel-AWS2-STS: Add more operation to the producer, getFederationToken
---
 .../camel/component/aws2/sts/STS2Constants.java    |  1 +
 .../camel/component/aws2/sts/STS2Operations.java   |  3 +-
 .../camel/component/aws2/sts/STS2Producer.java     | 40 ++++++++++++++++++++++
 .../component/aws2/sts/AmazonSTSClientMock.java    |  9 +++++
 .../camel/component/aws2/sts/STS2ProducerTest.java | 20 +++++++++++
 5 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Constants.java b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Constants.java
index fb2868f..79a2cb5 100644
--- a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Constants.java
+++ b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Constants.java
@@ -23,4 +23,5 @@ public interface STS2Constants {
     String OPERATION = "CamelAwsStsOperation";
     String ROLE_ARN = "CamelAwsStsRoleArn";
     String ROLE_SESSION_NAME = "CamelAwsStsRoleSessionName";
+    String FEDERATED_NAME = "CamelAwsStsFederatedName";
 }
diff --git a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Operations.java b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Operations.java
index 9d7c4b6..dda62e8 100644
--- a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Operations.java
+++ b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Operations.java
@@ -19,5 +19,6 @@ package org.apache.camel.component.aws2.sts;
 public enum STS2Operations {
 
     assumeRole,
-    getSessionToken
+    getSessionToken,
+    getFederationToken
 }
diff --git a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
index 816d83c..1d888c5 100644
--- a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
+++ b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
@@ -30,6 +30,8 @@ import software.amazon.awssdk.services.sts.StsClient;
 import software.amazon.awssdk.services.sts.model.AssumeRoleRequest;
 import software.amazon.awssdk.services.sts.model.AssumeRoleRequest.Builder;
 import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenRequest;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenResponse;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenRequest;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenResponse;
 
@@ -55,6 +57,9 @@ public class STS2Producer extends DefaultProducer {
             case getSessionToken:
                 getSessionToken(getEndpoint().getStsClient(), exchange);
                 break;
+            case getFederationToken:
+                getFederationToken(getEndpoint().getStsClient(), exchange);
+                break;
             default:
                 throw new IllegalArgumentException("Unsupported operation");
         }
@@ -154,6 +159,41 @@ public class STS2Producer extends DefaultProducer {
             message.setBody(result);
         }
     }
+    
+    private void getFederationToken(StsClient stsClient, Exchange exchange) throws InvalidPayloadException {
+        if (getConfiguration().isPojoRequest()) {
+            Object payload = exchange.getIn().getMandatoryBody();
+            if (payload instanceof GetFederationTokenRequest) {
+                GetFederationTokenResponse result;
+                try {
+                    GetFederationTokenRequest request = (GetFederationTokenRequest) payload;
+                    result = stsClient.getFederationToken(request);
+                } catch (AwsServiceException ase) {
+                    LOG.trace("Get Federation Token command returned the error code {}", ase.awsErrorDetails().errorCode());
+                    throw ase;
+                }
+                Message message = getMessageForResponse(exchange);
+                message.setBody(result);
+            }
+        } else {
+            GetFederationTokenRequest.Builder builder = GetFederationTokenRequest.builder();
+            GetFederationTokenResponse result;
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(STS2Constants.FEDERATED_NAME))) {
+                String federatedName = exchange.getIn().getHeader(STS2Constants.FEDERATED_NAME, String.class);
+                builder.name(federatedName);
+            } else {
+                throw new IllegalArgumentException("Role ARN needs to be specified for assumeRole operation");
+            }
+            try {
+                result = stsClient.getFederationToken(builder.build());
+            } catch (AwsServiceException ase) {
+                LOG.trace("Get Federation Token command returned the error code {}", ase.awsErrorDetails().errorCode());
+                throw ase;
+            }
+            Message message = getMessageForResponse(exchange);
+            message.setBody(result);
+        }
+    }
 
     public static Message getMessageForResponse(final Exchange exchange) {
         return exchange.getMessage();
diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
index ba8facb..1f4eab4 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
@@ -21,6 +21,8 @@ import software.amazon.awssdk.services.sts.model.AssumeRoleRequest;
 import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;
 import software.amazon.awssdk.services.sts.model.AssumedRoleUser;
 import software.amazon.awssdk.services.sts.model.Credentials;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenRequest;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenResponse;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenRequest;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenResponse;
 
@@ -40,6 +42,13 @@ public class AmazonSTSClientMock implements StsClient {
                 .credentials(Credentials.builder().accessKeyId("xxx").secretAccessKey("yyy").sessionToken("test").build())
                 .build();
     }
+    
+    @Override
+    public GetFederationTokenResponse getFederationToken(GetFederationTokenRequest getFederationTokenRequest) {
+        return GetFederationTokenResponse.builder()
+                .credentials(Credentials.builder().accessKeyId("xxx").secretAccessKey("yyy").sessionToken("test").build())
+                .build();
+    }
 
     @Override
     public String serviceName() {
diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
index 683065a..dd42751 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
@@ -25,6 +25,7 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 import software.amazon.awssdk.services.sts.model.AssumeRoleResponse;
+import software.amazon.awssdk.services.sts.model.GetFederationTokenResponse;
 import software.amazon.awssdk.services.sts.model.GetSessionTokenResponse;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -72,6 +73,23 @@ public class STS2ProducerTest extends CamelTestSupport {
         GetSessionTokenResponse resultGet = (GetSessionTokenResponse) exchange.getIn().getBody();
         assertEquals("xxx", resultGet.credentials().accessKeyId());
     }
+    
+    @Test
+    public void stsGetFederationTokenTest() throws Exception {
+
+        mock.expectedMessageCount(1);
+        Exchange exchange = template.request("direct:getFederationToken", new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setHeader(STS2Constants.OPERATION, STS2Operations.getFederationToken);
+            }
+        });
+
+        assertMockEndpointsSatisfied();
+
+        GetFederationTokenResponse resultGet = (GetFederationTokenResponse) exchange.getIn().getBody();
+        assertEquals("xxx", resultGet.credentials().accessKeyId());
+    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
@@ -82,6 +100,8 @@ public class STS2ProducerTest extends CamelTestSupport {
                         .to("mock:result");
                 from("direct:getSessionToken").to("aws2-sts://test?stsClient=#amazonStsClient&operation=getSessionToken")
                         .to("mock:result");
+                from("direct:getFederationToken").to("aws2-sts://test?stsClient=#amazonStsClient&operation=getFederationToken")
+                        .to("mock:result");
             }
         };
     }


[camel] 02/06: CAMEL-15374 - Regen and fixed CS

Posted by ac...@apache.org.
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.git

commit 77939a9eeda3ebd3fe1781d4e77ba03b6aca8ed6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Aug 27 08:40:26 2020 +0200

    CAMEL-15374 - Regen and fixed CS
---
 .../resources/org/apache/camel/component/aws2/sts/aws2-sts.json       | 4 ++--
 components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc       | 4 ++--
 .../main/java/org/apache/camel/component/aws2/sts/STS2Producer.java   | 2 +-
 .../java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java | 2 +-
 .../java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java    | 2 +-
 .../apache/camel/builder/endpoint/dsl/STS2EndpointBuilderFactory.java | 3 ++-
 6 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/components/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json b/components/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json
index a6045b6..d4c122d 100644
--- a/components/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json
+++ b/components/camel-aws2-sts/src/generated/resources/org/apache/camel/component/aws2/sts/aws2-sts.json
@@ -24,7 +24,7 @@
     "autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regist [...]
     "configuration": { "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.aws2.sts.STS2Configuration", "deprecated": false, "secret": false, "description": "Component configuration" },
     "lazyStartProducer": { "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the r [...]
-    "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.sts.STS2Operations", "enum": [ "assumeRole", "getSessionToken" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "assumeRole", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "The operation to pe [...]
+    "operation": { "kind": "property", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.sts.STS2Operations", "enum": [ "assumeRole", "getSessionToken", "getFederationToken" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "assumeRole", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description" [...]
     "pojoRequest": { "kind": "property", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "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, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the STS client" },
     "proxyPort": { "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the STS client" },
@@ -40,7 +40,7 @@
     "label": { "kind": "path", "displayName": "Label", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "Logical name" },
     "autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "true", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the regis [...]
     "lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": 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 starting and cause the  [...]
-    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.sts.STS2Operations", "enum": [ "assumeRole", "getSessionToken" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "assumeRole", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "The operation to p [...]
+    "operation": { "kind": "parameter", "displayName": "Operation", "group": "producer", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.aws2.sts.STS2Operations", "enum": [ "assumeRole", "getSessionToken", "getFederationToken" ], "deprecated": false, "deprecationNote": "", "secret": false, "defaultValue": "assumeRole", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description [...]
     "pojoRequest": { "kind": "parameter", "displayName": "Pojo Request", "group": "producer", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "secret": false, "defaultValue": "false", "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "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, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To define a proxy host when instantiating the STS client" },
     "proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.sts.STS2Configuration", "configurationField": "configuration", "description": "To define a proxy port when instantiating the STS client" },
diff --git a/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc b/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
index a5b47cc..872c8d3 100644
--- a/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
+++ b/components/camel-aws2-sts/src/main/docs/aws2-sts-component.adoc
@@ -51,7 +51,7 @@ The AWS 2 Security Token Service (STS) component supports 14 options, which are
 | *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *configuration* (producer) | Component configuration |  | STS2Configuration
 | *lazyStartProducer* (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 then creating and [...]
-| *operation* (producer) | *Required* The operation to perform. The value can be one of: assumeRole, getSessionToken | assumeRole | STS2Operations
+| *operation* (producer) | *Required* The operation to perform. The value can be one of: assumeRole, getSessionToken, getFederationToken | assumeRole | STS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the STS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the STS client |  | Integer
@@ -95,7 +95,7 @@ with the following path and query parameters:
 | Name | Description | Default | Type
 | *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
 | *lazyStartProducer* (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 then creating and [...]
-| *operation* (producer) | *Required* The operation to perform. The value can be one of: assumeRole, getSessionToken | assumeRole | STS2Operations
+| *operation* (producer) | *Required* The operation to perform. The value can be one of: assumeRole, getSessionToken, getFederationToken | assumeRole | STS2Operations
 | *pojoRequest* (producer) | If we want to use a POJO request as body or not | false | boolean
 | *proxyHost* (producer) | To define a proxy host when instantiating the STS client |  | String
 | *proxyPort* (producer) | To define a proxy port when instantiating the STS client |  | Integer
diff --git a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
index 1d888c5..8f2b783 100644
--- a/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
+++ b/components/camel-aws2-sts/src/main/java/org/apache/camel/component/aws2/sts/STS2Producer.java
@@ -159,7 +159,7 @@ public class STS2Producer extends DefaultProducer {
             message.setBody(result);
         }
     }
-    
+
     private void getFederationToken(StsClient stsClient, Exchange exchange) throws InvalidPayloadException {
         if (getConfiguration().isPojoRequest()) {
             Object payload = exchange.getIn().getMandatoryBody();
diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
index 1f4eab4..e083368 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/AmazonSTSClientMock.java
@@ -42,7 +42,7 @@ public class AmazonSTSClientMock implements StsClient {
                 .credentials(Credentials.builder().accessKeyId("xxx").secretAccessKey("yyy").sessionToken("test").build())
                 .build();
     }
-    
+
     @Override
     public GetFederationTokenResponse getFederationToken(GetFederationTokenRequest getFederationTokenRequest) {
         return GetFederationTokenResponse.builder()
diff --git a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
index dd42751..fe0489c 100644
--- a/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
+++ b/components/camel-aws2-sts/src/test/java/org/apache/camel/component/aws2/sts/STS2ProducerTest.java
@@ -73,7 +73,7 @@ public class STS2ProducerTest extends CamelTestSupport {
         GetSessionTokenResponse resultGet = (GetSessionTokenResponse) exchange.getIn().getBody();
         assertEquals("xxx", resultGet.credentials().accessKeyId());
     }
-    
+
     @Test
     public void stsGetFederationTokenTest() throws Exception {
 
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 c67bf6c..3863ac7 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
@@ -382,7 +382,8 @@ public interface STS2EndpointBuilderFactory {
      */
     enum STS2Operations {
         assumeRole,
-        getSessionToken;
+        getSessionToken,
+        getFederationToken;
     }
 
     /**