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 2023/11/22 09:37:57 UTC

(camel) 01/01: Camel-Azure-Storage-Blob: AZURE_SAS must be listed in the enums of CredentialsType

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

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

commit 0869b7ca180b7d4344f67c0037380fa444913230
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 22 10:37:04 2023 +0100

    Camel-Azure-Storage-Blob: AZURE_SAS must be listed in the enums of CredentialsType
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../org/apache/camel/catalog/components/azure-storage-blob.json       | 4 ++--
 .../apache/camel/component/azure/storage/blob/azure-storage-blob.json | 4 ++--
 .../apache/camel/component/azure/storage/blob/BlobConfiguration.java  | 2 +-
 .../blob/transform/AzureStorageBlobCloudEventDataTypeTransformer.java | 3 ++-
 .../transform/AzureStorageBlobCloudEventDataTypeTransformerTest.java  | 3 ++-
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-storage-blob.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-storage-blob.json
index 385372d4feb..6de17f467aa 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-storage-blob.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/azure-storage-blob.json
@@ -28,7 +28,7 @@
     "closeStreamAfterRead": { "index": 3, "kind": "property", "displayName": "Close Stream After Read", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after read or keep it open, default is true" },
     "configuration": { "index": 4, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" },
     "credentials": { "index": 5, "kind": "property", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client,  [...]
-    "credentialType": { "index": 6, "kind": "property", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfigura [...]
+    "credentialType": { "index": 6, "kind": "property", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY", "AZURE_SAS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob. [...]
     "dataCount": { "index": 7, "kind": "property", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." },
     "fileDir": { "index": 8, "kind": "property", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and cons [...]
     "maxResultsPerPage": { "index": 9, "kind": "property", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix elements. [...]
@@ -132,7 +132,7 @@
     "blobType": { "index": 5, "kind": "parameter", "displayName": "Blob Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobType", "enum": [ "blockblob", "appendblob", "pageblob" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "blockblob", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "d [...]
     "closeStreamAfterRead": { "index": 6, "kind": "parameter", "displayName": "Close Stream After Read", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after read or keep it open, default is true" },
     "credentials": { "index": 7, "kind": "parameter", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client, [...]
-    "credentialType": { "index": 8, "kind": "parameter", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfigur [...]
+    "credentialType": { "index": 8, "kind": "parameter", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY", "AZURE_SAS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob [...]
     "dataCount": { "index": 9, "kind": "parameter", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." },
     "fileDir": { "index": 10, "kind": "parameter", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and co [...]
     "maxResultsPerPage": { "index": 11, "kind": "parameter", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix element [...]
diff --git a/components/camel-azure/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json b/components/camel-azure/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json
index 385372d4feb..6de17f467aa 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json
+++ b/components/camel-azure/camel-azure-storage-blob/src/generated/resources/org/apache/camel/component/azure/storage/blob/azure-storage-blob.json
@@ -28,7 +28,7 @@
     "closeStreamAfterRead": { "index": 3, "kind": "property", "displayName": "Close Stream After Read", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after read or keep it open, default is true" },
     "configuration": { "index": 4, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" },
     "credentials": { "index": 5, "kind": "property", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client,  [...]
-    "credentialType": { "index": 6, "kind": "property", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfigura [...]
+    "credentialType": { "index": 6, "kind": "property", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY", "AZURE_SAS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob. [...]
     "dataCount": { "index": 7, "kind": "property", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." },
     "fileDir": { "index": 8, "kind": "property", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and cons [...]
     "maxResultsPerPage": { "index": 9, "kind": "property", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix elements. [...]
@@ -132,7 +132,7 @@
     "blobType": { "index": 5, "kind": "parameter", "displayName": "Blob Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.BlobType", "enum": [ "blockblob", "appendblob", "pageblob" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "blockblob", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "d [...]
     "closeStreamAfterRead": { "index": 6, "kind": "parameter", "displayName": "Close Stream After Read", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Close the stream after read or keep it open, default is true" },
     "credentials": { "index": 7, "kind": "parameter", "displayName": "Credentials", "group": "common", "label": "", "required": false, "type": "object", "javaType": "com.azure.storage.common.StorageSharedKeyCredential", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "StorageSharedKeyCredential can be injected to create the azure client, [...]
-    "credentialType": { "index": 8, "kind": "parameter", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfigur [...]
+    "credentialType": { "index": 8, "kind": "parameter", "displayName": "Credential Type", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.blob.CredentialType", "enum": [ "SHARED_ACCOUNT_KEY", "SHARED_KEY_CREDENTIAL", "AZURE_IDENTITY", "AZURE_SAS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "AZURE_IDENTITY", "configurationClass": "org.apache.camel.component.azure.storage.blob [...]
     "dataCount": { "index": 9, "kind": "parameter", "displayName": "Data Count", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Long", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "How many bytes to include in the range. Must be greater than or equal to 0 if specified." },
     "fileDir": { "index": 10, "kind": "parameter", "displayName": "File Dir", "group": "common", "label": "common", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "The file directory where the downloaded blobs will be saved to, this can be used in both, producer and co [...]
     "maxResultsPerPage": { "index": 11, "kind": "parameter", "displayName": "Max Results Per Page", "group": "common", "label": "common", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.blob.BlobConfiguration", "configurationField": "configuration", "description": "Specifies the maximum number of blobs to return, including all BlobPrefix element [...]
diff --git a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java
index 9e03a55998e..50cdda3ab8f 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/BlobConfiguration.java
@@ -101,7 +101,7 @@ public class BlobConfiguration implements Cloneable {
     private String regex;
     @UriParam(label = "security", secret = true)
     private String sourceBlobAccessKey;
-    @UriParam(label = "common", enums = "SHARED_ACCOUNT_KEY,SHARED_KEY_CREDENTIAL,AZURE_IDENTITY",
+    @UriParam(label = "common", enums = "SHARED_ACCOUNT_KEY,SHARED_KEY_CREDENTIAL,AZURE_IDENTITY,AZURE_SAS",
               defaultValue = "AZURE_IDENTITY")
     private CredentialType credentialType = AZURE_IDENTITY;
 
diff --git a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformer.java b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformer.java
index d8723ff657f..de1f7d0d609 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformer.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/main/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformer.java
@@ -44,7 +44,8 @@ public class AzureStorageBlobCloudEventDataTypeTransformer extends Transformer {
         headers.put(CloudEvents.CAMEL_CLOUD_EVENT_TYPE, "org.apache.camel.event.azure.storage.blob.getBlob");
 
         if (message.getHeaders().containsKey(BlobConstants.E_TAG)) {
-            headers.put(CloudEvents.CAMEL_CLOUD_EVENT_SOURCE, "azure.storage.blob." + message.getHeader(BlobConstants.E_TAG, String.class));
+            headers.put(CloudEvents.CAMEL_CLOUD_EVENT_SOURCE,
+                    "azure.storage.blob." + message.getHeader(BlobConstants.E_TAG, String.class));
         }
 
         headers.put(CloudEvents.CAMEL_CLOUD_EVENT_SUBJECT, message.getHeader(BlobConstants.BLOB_NAME, String.class));
diff --git a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformerTest.java b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformerTest.java
index a15ebd65a89..dab5d003261 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformerTest.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/transform/AzureStorageBlobCloudEventDataTypeTransformerTest.java
@@ -37,7 +37,8 @@ public class AzureStorageBlobCloudEventDataTypeTransformerTest {
 
     private final DefaultCamelContext camelContext = new DefaultCamelContext();
 
-    private final AzureStorageBlobCloudEventDataTypeTransformer transformer = new AzureStorageBlobCloudEventDataTypeTransformer();
+    private final AzureStorageBlobCloudEventDataTypeTransformer transformer
+            = new AzureStorageBlobCloudEventDataTypeTransformer();
 
     @Test
     void shouldMapToCloudEvent() throws Exception {