Andrea Cosentino created CAMEL-24472:
----------------------------------------

             Summary: camel-ibm-secrets-manager: endpoint credential validation 
uses && so a half-configured endpoint passes
                 Key: CAMEL-24472
                 URL: https://issues.apache.org/jira/browse/CAMEL-24472
             Project: Camel
          Issue Type: Bug
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.23.0


IBMSecretsManagerComponent.createEndpoint() validates the required credentials 
with:

{code:java}
if (epConfiguration.getServiceUrl() == null
        && epConfiguration.getToken() == null) {
    throw new IllegalArgumentException(
            "Service URL and Token must be specified");
}
{code}

Because the condition uses &&, the exception is thrown only when BOTH the 
service URL and the token are missing. An endpoint configured with just one of 
the two (for example a token but no service URL, or vice versa) passes this 
validation and then fails later with a less clear error. The message states 
that both must be specified, so the check should use || (throw when either one 
is missing).

Affected: components/camel-ibm/camel-ibm-secrets-manager 
(org.apache.camel.component.ibm.secrets.manager.IBMSecretsManagerComponent).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to