[ 
https://issues.apache.org/jira/browse/CAMEL-24292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113858#comment-18113858
 ] 

Andrea Cosentino commented on CAMEL-24292:
------------------------------------------

Opened a *draft* PR for the camel-sql + camel-sql-stored parts: 
https://github.com/apache/camel/pull/26268

- camel-sql: new allowQueryFromHeader (default false) gates the CamelSqlQuery 
header.
- camel-sql-stored: new allowTemplateFromHeader (default false) gates the 
CamelSqlStoredTemplate header; a header-supplied template is resolved with 
placeholders only (never file:/http:).

Kept as a draft pending two things: (1) PMC confirmation on the default - this 
gates a currently-honoured header, the discussion point noted on this issue; 
(2) the dsl/ EndpointBuilderFactory regen, which needs a full reactor build 
(blocked locally by an unrelated langchain4j-embeddings model-jar download).

The camel-xslt CamelXsltFileName part is deferred: the xslt 
FileResultHandlerFactory is shared with camel-xj (which also has its own 
JsonFileResultHandlerFactory reading the same header ungated), so it needs a 
separate, wider change.

_Claude Code on behalf of Andrea Cosentino (@oscerd)_

> camel-sql, camel-sql-stored and camel-xslt: add opt-in gate for override 
> headers for parity with sibling components
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24292
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24292
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-sql, camel-xslt
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Minor
>
> Components that let a message header override the endpoint-configured 
> template/query expose an explicit opt-in flag (allowTemplateFromHeader / 
> allowControlHeaders, default false). A few read their override header 
> unconditionally:
> - camel-sql: SqlProducer reads CamelSqlQuery ungated -> add 
> allowQueryFromHeader on DefaultSqlEndpoint.
> - camel-sql-stored: SqlStoredProducer reads CamelSqlStoredTemplate ungated; 
> the value additionally flows through SqlHelper.resolveQuery -> ResourceHelper 
> (which resolves file:/http: schemes) -> add a gate and use placeholder-only 
> resolution on header-derived input.
> - camel-xslt: FileResultHandlerFactory reads CamelXsltFileName ungated, while 
> CamelXsltResourceUri/Stylesheet are gated by allowTemplateFromHeader -> gate 
> consistently.
> Note: gating a currently-honoured header (especially CamelSqlQuery) is a 
> behavioural change -> needs an upgrade-guide entry and PMC input on the 
> default. Filed for discussion.
> _Filed by Claude Code on behalf of Andrea Cosentino._



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

Reply via email to