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 2024/02/01 14:20:43 UTC

(camel) branch main updated: Camel 20281 s3 refine (#12972)

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


The following commit(s) were added to refs/heads/main by this push:
     new 57d113b01a7 Camel 20281 s3 refine (#12972)
57d113b01a7 is described below

commit 57d113b01a706316ce5b1cd421e8279cc23a8419
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Feb 1 15:20:37 2024 +0100

    Camel 20281 s3 refine (#12972)
    
    * CAMEL-20281 - Camel-AWS Components: Make it possible to use AwsSessionCredentials to support temporary credentials - AWS S3, added check for presence of sessionToken
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
    
    * CAMEL-20281 - Camel-AWS Components: Make it possible to use AwsSessionCredentials to support temporary credentials - AWS S3, added check for presence of sessionToken
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
    
    ---------
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../component/aws2/s3/client/impl/AWS2S3ClientSessionTokenImpl.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/client/impl/AWS2S3ClientSessionTokenImpl.java b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/client/impl/AWS2S3ClientSessionTokenImpl.java
index 6e6b324c07f..610231ef48c 100644
--- a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/client/impl/AWS2S3ClientSessionTokenImpl.java
+++ b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/client/impl/AWS2S3ClientSessionTokenImpl.java
@@ -70,7 +70,8 @@ public class AWS2S3ClientSessionTokenImpl implements AWS2CamelS3InternalClient {
             httpClientBuilder = ApacheHttpClient.builder().proxyConfiguration(proxyConfig.build());
             isClientConfigFound = true;
         }
-        if (configuration.getAccessKey() != null && configuration.getSecretKey() != null) {
+        if (configuration.getAccessKey() != null && configuration.getSecretKey() != null
+                && configuration.getSessionToken() != null) {
             AwsSessionCredentials cred = AwsSessionCredentials.create(configuration.getAccessKey(),
                     configuration.getSecretKey(), configuration.getSessionToken());
             if (isClientConfigFound) {