[
https://issues.apache.org/jira/browse/CAMEL-27708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-27708.
---------------------------------
Resolution: Fixed
> camel-consul - the aclToken is sent as a query parameter, and received events
> are logged at INFO
> ------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27708
> URL: https://issues.apache.org/jira/browse/CAMEL-27708
> Project: Camel
> Issue Type: Bug
> Components: camel-consul
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> h4. 1. The aclToken is sent as a query parameter
> {{ConsulClientConfiguration.createConsulClient()}} configures the client with
> {{Consul.Builder.withAclToken(aclToken)}}. In consul-client 1.12.2 this adds
> an okhttp interceptor that appends {{?token=...}} (or {{&token=...}}) to the
> URL of every request; it does not set the {{X-Consul-Token}} header
> ({{withTokenAuth()}} does). In addition,
> {{AbstractConsulProducer.buildQueryOptions()}} copies the {{aclToken}} option
> into {{QueryOptions.token}}, which {{QueryOptions.toQuery()}} also turns into
> a {{token}} query parameter, so the catalog actions LIST_NODES,
> LIST_SERVICES, GET_SERVICE and GET_NODE, the health actions and the agent
> DEREGISTER action send it twice in the URL.
> A token in a URL ends up in proxy and access logs, and Consul has deprecated
> the {{token}} query parameter in favour of the header. When the user
> configures their own {{consulClient}}, the endpoint {{aclToken}} is still
> added to the URL of these actions, next to the token of that client.
> Proposed change: create the client with {{withTokenAuth(aclToken)}} (the
> {{X-Consul-Token}} header) and do not put the token into the
> {{QueryOptions}}. With a custom {{consulClient}}, the token configured on
> that client is used (document it, and add an upgrade guide entry).
> h4. 2. Received events are logged at INFO
> {{ConsulEventConsumer.EventWatcher.onEvent()}} logs every received event with
> {{info("{}", event)}}. The {{toString()}} of the event includes its payload,
> so the content of every event ends up in the log at INFO level.
> Proposed change: log the event id and name at DEBUG, and the full event only
> at TRACE.
> _Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)