This is an automated email from the ASF dual-hosted git repository.
oscerd 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 80a6ad295cd6 CAMEL-24383: camel-azure-key-vault - fix copy-pasted
validation messages (#25574)
80a6ad295cd6 is described below
commit 80a6ad295cd6c4c326467816dbf4fe03a956b811
Author: Andrea Cosentino <[email protected]>
AuthorDate: Sat Aug 22 20:37:51 2026 +0200
CAMEL-24383: camel-azure-key-vault - fix copy-pasted validation messages
(#25574)
KeyVaultProducer used one constant, MISSING_SECRET_NAME = "Secret Name must
be
specified for createSecret Operation", for all five operations. So
getSecret,
deleteSecret and purgeDeletedSecret named the wrong operation, and
updateSecretProperties was doubly wrong: it validates the SECRET_PROPERTIES
header (not a name) yet reported "Secret Name ... createSecret".
Make the shared message generic ("Secret Name must be specified") and give
updateSecretProperties its own MISSING_SECRET_PROPERTIES message. Diagnostic
text only; behaviour and the thrown exception type are unchanged.
Signed-off-by: Andrea Cosentino <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
---
.../org/apache/camel/component/azure/key/vault/KeyVaultProducer.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultProducer.java
b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultProducer.java
index c2bc029ef336..23749cb1922e 100644
---
a/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultProducer.java
+++
b/components/camel-azure/camel-azure-key-vault/src/main/java/org/apache/camel/component/azure/key/vault/KeyVaultProducer.java
@@ -29,7 +29,8 @@ import org.apache.camel.util.ObjectHelper;
public class KeyVaultProducer extends DefaultProducer {
- public static final String MISSING_SECRET_NAME = "Secret Name must be
specified for createSecret Operation";
+ public static final String MISSING_SECRET_NAME = "Secret Name must be
specified";
+ public static final String MISSING_SECRET_PROPERTIES = "Secret Properties
must be specified";
public KeyVaultProducer(final Endpoint endpoint) {
super(endpoint);
@@ -85,7 +86,7 @@ public class KeyVaultProducer extends DefaultProducer {
final SecretProperties secretProperties
=
exchange.getMessage().getHeader(KeyVaultConstants.SECRET_PROPERTIES,
SecretProperties.class);
if (ObjectHelper.isEmpty(secretProperties)) {
- throw new IllegalArgumentException(MISSING_SECRET_NAME);
+ throw new IllegalArgumentException(MISSING_SECRET_PROPERTIES);
}
SecretProperties p = getEndpoint().getSecretClient()
.updateSecretProperties(secretProperties);