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

davsclaus pushed a commit to branch camel-4.8.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.8.x by this push:
     new dc08574c51b CAMEL-21287: Camel-Azure-Files add missing header for 
AZURE_IDENTITY (#15758)
dc08574c51b is described below

commit dc08574c51b26bedf6eda24865b0aff2c2b16719
Author: s-clauw <[email protected]>
AuthorDate: Mon Sep 30 11:47:31 2024 +0200

    CAMEL-21287: Camel-Azure-Files add missing header for AZURE_IDENTITY 
(#15758)
    
    The header x-ms-file-request-intent must be set before calling the file 
share api using a bearer token.
---
 .../java/org/apache/camel/component/file/azure/FilesOperations.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesOperations.java
 
b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesOperations.java
index 151f9732f07..d7733614650 100644
--- 
a/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesOperations.java
+++ 
b/components/camel-azure/camel-azure-files/src/main/java/org/apache/camel/component/file/azure/FilesOperations.java
@@ -37,6 +37,7 @@ import com.azure.storage.file.share.ShareServiceClientBuilder;
 import com.azure.storage.file.share.models.ShareFileItem;
 import com.azure.storage.file.share.models.ShareFileRange;
 import com.azure.storage.file.share.models.ShareStorageException;
+import com.azure.storage.file.share.models.ShareTokenIntent;
 import com.azure.storage.file.share.options.ShareDirectoryCreateOptions;
 import com.azure.storage.file.share.options.ShareFileRenameOptions;
 import 
com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions;
@@ -717,6 +718,7 @@ public class FilesOperations extends NormalizedOperations {
             builder = builder.sasToken(token.toURIQuery());
         } else if 
(configuration.getCredentialType().equals(CredentialType.AZURE_IDENTITY)) {
             builder = builder.credential(new 
DefaultAzureCredentialBuilder().build());
+            builder.shareTokenIntent(ShareTokenIntent.BACKUP);
         }
         return builder.buildClient();
     }

Reply via email to