oscerd opened a new pull request, #2977:
URL: https://github.com/apache/camel-kamelets/pull/2977

   Partially addresses #2973 — the tier-1 SQL/CQL slice. HTTP is in a sibling 
PR (#2976); broker sinks and the tier-3 mixed cases (`exec-sink`, `kafka-sink`, 
`aws-ec2-sink`) are still open.
   
   The nine SQL/CQL sinks dispatch an operator-bound `{{query}}` while passing 
every inbound header straight through to the producer:
   
   `aws-redshift-sink`, `databricks-sink`, `mariadb-sink`, `mysql-sink`, 
`oracle-database-sink`, `postgresql-sink`, `snowflake-sink`, `sqlserver-sink`, 
`cassandra-sink`
   
   `camel-sql` documents `CamelSqlQuery` as *"Query to execute. This query 
takes precedence over the query specified in the endpoint URI"*, and 
`camel-cassandraql` documents `CamelCqlQuery` the same way.
   
   ```diff
          - unmarshal:
              json:
                library: Jackson
   +      - removeHeader:
   +          name: CamelSqlQuery
   +      - removeHeader:
   +          name: CamelSqlParameters
          - to:
              uri: "{{local-sql-postgres-sink}}:{{query}}"
   ```
   
   `cassandra-sink` gets `CamelCqlQuery`; the other eight get `CamelSqlQuery` 
and `CamelSqlParameters`.
   
   ### Verified against H2
   
   A route whose endpoint query asked for `intended`, with a `CamelSqlQuery` 
header asking for `secret`:
   
   | template shape | result |
   |---|---|
   | as shipped | `[{NAME=secret}]` |
   | with the removeHeader steps | `[{NAME=intended}]` |
   
   The override is wholesale — the header replaces the operator's query rather 
than augmenting it.
   
   ### Tier
   
   Tier 1 in #2973's taxonomy, and the clearest case in the set: these 
templates map **no** headers of their own and declare no `types.*.headers:` 
interface. The query is exposed solely as an operator-bound `{{query}}` 
property, so nothing about the template invites a wire-supplied query and no 
contract is being removed.
   
   ### Scope note
   
   Sinks only. `CamelSqlQuery` is a producer header, so the SQL *sources* are 
unaffected.
   
   This does not change what the security model says about SQL Kamelets — an 
operator binding `{{query}}` to untrusted data remains route-author 
responsibility and out of scope. This is about the separate case where the 
template never asked for a wire query at all.
   
   ### Verification
   
   - `script/validator` reports no errors
   - `mvn verify` passes
   - Override and fix verified with `camel run` against an in-memory H2 
database as tabulated
   
   ---
   _Claude Code on behalf of Andrea Cosentino_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to