Claus Ibsen created CAMEL-27976:
-----------------------------------

             Summary: camel-twilio: component configuration option has no 
effect, username without password passes the start check
                 Key: CAMEL-27976
                 URL: https://issues.apache.org/jira/browse/CAMEL-27976
             Project: Camel
          Issue Type: Bug
          Components: camel-twilio
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-twilio for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31202).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. The component configuration option has no effect
{{TwilioComponent}} declares its own private configuration field, which hides 
AbstractApiComponent.configuration, and setConfiguration() does not call 
super.setConfiguration(). AbstractApiComponent.createEndpointConfiguration() 
reads the super field, which stays null, so the configuration component option 
never reaches the endpoints. It only holds apiName and methodName, which the 
URI sets anyway.
Proposed change: drop the field and delegate to super, as ZendeskComponent 
does, or deprecate the option.

h4. 2. Only username or only password passes the start check
{{TwilioComponent.doStart}} checks isEmpty(username) && isEmpty(password), so 
with only one of them set the component starts and builds 
TwilioRestClient.Builder(username, null). TwilioRestClient.request() only sets 
basic auth when both are set, so every call fails with HTTP 401.
Proposed change: fail at start when either is empty (||).

h4. 3. Smaller issues
Only the parameters of the static creator()/reader()/... methods are endpoint 
options; the optional request settings of the SDK (startDate/endDate/category 
of usage-record read, statusCallback of message create, ttl of token create) 
can only be set with CamelTwilio.<name> headers, which the doc page does not 
say. tooling/camel-tooling-model/src/test/resources/twilio.json keeps the old 
component description (the test does not check it).


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to