Andrea Cosentino created CAMEL-28021:
----------------------------------------
Summary: camel-pinecone - tls option now defaults to true
Key: CAMEL-28021
URL: https://issues.apache.org/jira/browse/CAMEL-28021
Project: Camel
Issue Type: Bug
Components: camel-pinecone
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
Fix For: 4.25.0
h3. Background
The {{camel-pinecone}} component is a producer that talks to the Pinecone
vector database over two planes: a control plane (REST, index and collection
management) and a data plane (gRPC: upsert, query, fetch, update and delete of
vectors). The {{tls}} endpoint option governs whether the data-plane gRPC
connection uses TLS.
h3. Current behaviour
The {{tls}} option is a plain {{boolean}} field in
{{PineconeVectorDbConfiguration}} with no initializer, so its runtime default
is {{false}} (the {{@UriParam(defaultValue = "false")}} is catalog and doc
metadata only, it is not applied to the field at runtime).
{{PineconeVectorDbEndpoint.createClient()}} always calls
{{builder.withTlsEnabled(configuration.isTls())}}, so with the default the
builder receives {{false}} and the data-plane gRPC channel is established
without TLS (plaintext).
This is the opposite of the Pinecone client's own default: the client enables
TLS by default ({{PineconeConfig.enableTLS = true}}). The component therefore
turns a TLS-by-default client into a plaintext one unless the route author sets
{{tls=true}}. Because the data-plane host is always a remote Pinecone-cloud
endpoint (resolved from the control plane at {{https://api.pinecone.io}}), the
default is wrong for the normal, expected configuration; {{tls=false}} is only
appropriate for a local endpoint such as Pinecone Local. The control plane
(REST) is unaffected: it uses the scheme of the {{host}} option and defaults to
HTTPS.
h3. Proposed change
Flip the runtime default of {{tls}} to {{true}} so the data-plane connection
uses TLS by default, matching the Pinecone client's own default:
* {{PineconeVectorDbConfiguration}}: initialize the field as {{private boolean
tls = true;}} and change the {{@UriParam}} {{defaultValue}} from {{"false"}} to
{{"true"}}, rewording the option description for the new default. The option's
other {{@UriParam}} attributes are unchanged.
* {{PineconeVectorDbEndpoint.createClient()}}: no code change needed. The
existing {{builder.withTlsEnabled(configuration.isTls())}} now passes {{true}}
by default.
* Regenerate and commit the generated metadata and docs: the component JSON and
its catalog mirror ({{pinecone.json}}), the configurers and the URI factory,
the component and endpoint builder factories, and {{pinecone-component.adoc}}
with its catalog doc mirror (the {{tls}} {{defaultValue}} flips to {{true}}).
Routes that connect to a plaintext endpoint such as Pinecone Local must now set
{{tls=false}} explicitly. This is a behavioural change, so it must be recorded
in the matching upgrade guide on {{main}}.
h3. Tests
Extend {{PineconeComponentConfigurationTest}}: assert that an endpoint created
with no {{tls}} in the URI reports {{isTls()}} is {{true}} (the new default),
and that {{?tls=false}} still yields {{false}}. The existing
{{createEndpointWithProperties}} test asserts an explicit {{tls=false}} loaded
from {{pinecone_index.properties}} and is unaffected by the default change. The
class uses JUnit {{assertEquals}}, so keep the new assertions in that style.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)