From dc0141c47a11bcf31a0a7b8ce772f55577d42fe0 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 11:50:33 +0100 Subject: [PATCH 1/6] Azure Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB Sink Signed-off-by: Andrea Cosentino --- kamelets/azure-cosmosdb-sink.kamelet.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/kamelets/azure-cosmosdb-sink.kamelet.yaml b/kamelets/azure-cosmosdb-sink.kamelet.yaml index a45cc6671..2e077c57b 100644 --- a/kamelets/azure-cosmosdb-sink.kamelet.yaml +++ b/kamelets/azure-cosmosdb-sink.kamelet.yaml @@ -37,10 +37,13 @@ spec: In the headers, you can optionally set the `itemPartitionKey` / `ce-itemPartitionKey` property to specify the partition key for a specific item. If you do not set the property in the header, you'll need to use the static property itemPartitonKey. + + There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed. + + In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell. required: - databaseName - containerName - - accountKey - databaseEndpoint type: object properties: @@ -67,6 +70,12 @@ spec: title: Item Partition Key description: Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in. type: string + credentialType: + title: Credential Type + description: Determines the credential strategy to adopt. + type: string + enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"] + default: "SHARED_ACCOUNT_KEY" types: in: mediaType: application/json @@ -106,4 +115,5 @@ spec: databaseEndpoint: "{{databaseEndpoint}}" itemPartitionKey: "{{?itemPartitionKey}}" operation: createItem + credentialType: "{{credentialType}}" From f444acb8af124bfa825ece87c7f8a4cdd2e87c92 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 11:51:44 +0100 Subject: [PATCH 2/6] Azure Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB Sink Signed-off-by: Andrea Cosentino --- .../kamelets/azure-cosmosdb-sink.kamelet.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml index a45cc6671..2e077c57b 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml @@ -37,10 +37,13 @@ spec: In the headers, you can optionally set the `itemPartitionKey` / `ce-itemPartitionKey` property to specify the partition key for a specific item. If you do not set the property in the header, you'll need to use the static property itemPartitonKey. + + There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed. + + In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell. required: - databaseName - containerName - - accountKey - databaseEndpoint type: object properties: @@ -67,6 +70,12 @@ spec: title: Item Partition Key description: Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in. type: string + credentialType: + title: Credential Type + description: Determines the credential strategy to adopt. + type: string + enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"] + default: "SHARED_ACCOUNT_KEY" types: in: mediaType: application/json @@ -106,4 +115,5 @@ spec: databaseEndpoint: "{{databaseEndpoint}}" itemPartitionKey: "{{?itemPartitionKey}}" operation: createItem + credentialType: "{{credentialType}}" From ac7e9035279bdf0fb52995928f97f78c74c9dd95 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 11:55:37 +0100 Subject: [PATCH 3/6] Azure Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB Source Signed-off-by: Andrea Cosentino --- kamelets/azure-cosmosdb-source.kamelet.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kamelets/azure-cosmosdb-source.kamelet.yaml b/kamelets/azure-cosmosdb-source.kamelet.yaml index bcd2b335e..f94196095 100644 --- a/kamelets/azure-cosmosdb-source.kamelet.yaml +++ b/kamelets/azure-cosmosdb-source.kamelet.yaml @@ -32,11 +32,14 @@ spec: definition: title: "Azure CosmosDB Source" description: |- - Consume Changes from a CosmosDB instance + Consume Changes from a CosmosDB instance. + + There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed. + + In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell. required: - databaseName - containerName - - accountKey - databaseEndpoint type: object properties: @@ -77,6 +80,12 @@ spec: title: Database Endpoint description: Sets the Azure Cosmos database endpoint the component will connect to. type: string + credentialType: + title: Credential Type + description: Determines the credential strategy to adopt. + type: string + enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"] + default: "SHARED_ACCOUNT_KEY" types: out: mediaType: application/json @@ -90,10 +99,11 @@ spec: parameters: leaseDatabaseName: "{{?leaseDatabaseName}}" leaseContainerName: "{{?leaseContainerName}}" - accountKey: "{{accountKey}}" + accountKey: "{{?accountKey}}" createLeaseDatabaseIfNotExists: "{{createLeaseDatabaseIfNotExists}}" createLeaseContainerIfNotExists: "{{createLeaseContainerIfNotExists}}" databaseEndpoint: "{{databaseEndpoint}}" + credentialType: "{{credentialType}}" steps: - marshal: json: {} From 1b4277fd5e573f97974079c8f77af4ddceabae49 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 11:56:26 +0100 Subject: [PATCH 4/6] Azure Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB Source Signed-off-by: Andrea Cosentino --- .../kamelets/azure-cosmosdb-source.kamelet.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-source.kamelet.yaml index bcd2b335e..f94196095 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-source.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-source.kamelet.yaml @@ -32,11 +32,14 @@ spec: definition: title: "Azure CosmosDB Source" description: |- - Consume Changes from a CosmosDB instance + Consume Changes from a CosmosDB instance. + + There are two different mechanism of authentication `SHARED_ACCOUNT_KEY` and `AZURE_IDENTITY`, you could specify with credentialType property. If you're using `SHARED_ACCOUNT_KEY` accountKey property will be needed. + + In case of `AZURE_IDENTITY` selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell. required: - databaseName - containerName - - accountKey - databaseEndpoint type: object properties: @@ -77,6 +80,12 @@ spec: title: Database Endpoint description: Sets the Azure Cosmos database endpoint the component will connect to. type: string + credentialType: + title: Credential Type + description: Determines the credential strategy to adopt. + type: string + enum: ["SHARED_ACCOUNT_KEY", "AZURE_IDENTITY"] + default: "SHARED_ACCOUNT_KEY" types: out: mediaType: application/json @@ -90,10 +99,11 @@ spec: parameters: leaseDatabaseName: "{{?leaseDatabaseName}}" leaseContainerName: "{{?leaseContainerName}}" - accountKey: "{{accountKey}}" + accountKey: "{{?accountKey}}" createLeaseDatabaseIfNotExists: "{{createLeaseDatabaseIfNotExists}}" createLeaseContainerIfNotExists: "{{createLeaseContainerIfNotExists}}" databaseEndpoint: "{{databaseEndpoint}}" + credentialType: "{{credentialType}}" steps: - marshal: json: {} From a5881cafe540f0bef1f50d63a1cdaf0c877d847b Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 11:59:13 +0100 Subject: [PATCH 5/6] Azure Kamelets: Reflect changes coming from CAMEL-18590 - Azure CosmosDB Sink Signed-off-by: Andrea Cosentino --- kamelets/azure-cosmosdb-sink.kamelet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kamelets/azure-cosmosdb-sink.kamelet.yaml b/kamelets/azure-cosmosdb-sink.kamelet.yaml index 2e077c57b..29421a059 100644 --- a/kamelets/azure-cosmosdb-sink.kamelet.yaml +++ b/kamelets/azure-cosmosdb-sink.kamelet.yaml @@ -111,7 +111,7 @@ spec: - to: uri: "azure-cosmosdb:{{databaseName}}/{{containerName}}" parameters: - accountKey: "{{accountKey}}" + accountKey: "{{?accountKey}}" databaseEndpoint: "{{databaseEndpoint}}" itemPartitionKey: "{{?itemPartitionKey}}" operation: createItem From 685ce1d5affe948199bc711949fad8c85b46adff Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Thu, 25 Jan 2024 12:02:13 +0100 Subject: [PATCH 6/6] Move to Camel 4.4.0-SNAPSHOT Signed-off-by: Andrea Cosentino --- .../apache/camel/kamelets/catalog/KameletsCatalogTest.java | 2 +- .../main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml | 2 +- pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java index abb5b9957..993a7fd6f 100644 --- a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java +++ b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java @@ -138,7 +138,7 @@ void testAllKameletDependencies() throws Exception { void testSupportedHeaders() throws Exception { verifyHeaders("aws-s3-source", 20); verifyHeaders("aws-s3-sink", 27); - verifyHeaders("aws-cloudtrail-source", 0); + verifyHeaders("aws-cloudtrail-source", 4); verifyHeaders("aws-redshift-source", 0); verifyHeaders("aws-not-exists", 0); verifyHeaders("azure-eventhubs-sink", 2); diff --git a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml index 2e077c57b..29421a059 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/azure-cosmosdb-sink.kamelet.yaml @@ -111,7 +111,7 @@ spec: - to: uri: "azure-cosmosdb:{{databaseName}}/{{containerName}}" parameters: - accountKey: "{{accountKey}}" + accountKey: "{{?accountKey}}" databaseEndpoint: "{{databaseEndpoint}}" itemPartitionKey: "{{?itemPartitionKey}}" operation: createItem diff --git a/pom.xml b/pom.xml index 2c3cdf352..94e4b37a8 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.apache.camel camel-dependencies - 4.3.0 + 4.4.0-SNAPSHOT org.apache.camel.kamelets @@ -62,7 +62,7 @@ 0.16 2.7.11 - 4.3.0 + 4.4.0-SNAPSHOT 2.2.0 4.1.0