Andrea Cosentino created CAMEL-28050:
----------------------------------------
Summary: camel-azure: give camel-azure-common a credential
resolver, and close the proxy and secret-marking gaps
Key: CAMEL-28050
URL: https://issues.apache.org/jira/browse/CAMEL-28050
Project: Camel
Issue Type: Task
Components: camel-azure
Reporter: Andrea Cosentino
Found during an audit of the cloud components (camel-aws, camel-azure,
camel-google, camel-huawei) at commit 7c0644752e17. Every item below was
verified against the source.
h4. 1. camel-azure-common holds no credential logic
The module is two classes, {{CredentialType}} and {{AzureFileNameHelper}} (both
correct and both used). It has no common configuration, no credential resolver
and no exception helper, so every component re-derives its credentials. {{new
DefaultAzureCredentialBuilder()}} appears in 13 places across
BlobClientFactory, EventGridProducer, FilesOperations, FunctionsClientFactory,
EventHubsClientFactory and KeyVaultPropertiesFunction, and the
{{ClientSecretCredentialBuilder}} block is duplicated three times.
camel-aws has {{AwsCommonConfiguration}} + {{AwsClientBuilderUtil}} (42 and 43
users) and camel-google has {{GoogleCommonConfiguration}} +
{{GoogleCredentialsHelper}} (21 users). camel-azure is the family without the
shared layer.
Proposed change: add an {{AzureCommonConfiguration}} and a credential resolver
to camel-azure-common and migrate the components to it.
h4. 2. azure-functions is the only module whose tokenCredential is not marked
secret
{{FunctionsConfiguration.tokenCredential}} carries {{@UriParam(label =
"security")}} and {{@Metadata(autowired = true)}} but no {{security =
"secret"}}. azure-eventgrid, azure-eventhubs and azure-servicebus all mark
theirs, so the value is masked there and not here.
h4. 3. Ten of the thirteen schemes have no proxy options
Only azure-servicebus exposes a proxy option ({{proxyOptions}}, applied in
ServiceBusClientFactory). cosmosdb, eventgrid, eventhubs, files, functions,
iothub, key-vault, storage-blob, storage-datalake and storage-queue have none,
while all 38 AWS and all 7 Huawei schemes do. Behind a corporate proxy these
components are unusable without a JVM-wide setting.
h4. 4. Smaller issues
{{BlobConstants.DESTINATION_BLOB_NAME}} is the only one of 84 blob header
constants without {{@Metadata}}, it is referenced nowhere in the module, and
the constant named {{..._BLOB_NAME}} holds the value
{{"...DestinationBlobContainerName"}}. Either the value is a typo in a header
users are expected to set for copyBlob, or the constant should be removed.
{{clientId}} is marked secret in azure-functions and azure-key-vault but not in
azure-storage-datalake (which also lacks {{label = "security"}}) nor in the six
google OAuth components. An Entra or OAuth client id is a public identifier, so
the likely fix is to unmark the two and add the label to datalake - but it
should be decided once for all eight.
Related: CAMEL-18654 (allow overriding the client endpoint), CAMEL-27750 (mask
the Azure tenantId).
_Claude Code on behalf of oscerd_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)