oscerd opened a new issue, #1798:
URL: https://github.com/apache/camel-kafka-connector/issues/1798

   ## Description
   
   The kamelet-based generator emits `ConfigDef.Type.PASSWORD` when a kamelet 
property declares
   `format: password` 
(`CamelKafkaConnectorKameletUpdateMojo.addConnectorOptions`, lines 606-611).
   Across the shipped connector modules this holds for the overwhelming 
majority of password/passphrase
   options, but five checked-in config classes declare them as 
`ConfigDef.Type.STRING` even though the
   kamelet YAML bundled in the same module declares `format: password` (and
   `x-descriptors: urn:camel:group:credentials`):
   
   | Connector module | Option | Current type |
   |---|---|---|
   | `camel-jms-pooled-apache-artemis-sink-kafka-connector` | 
`camel.kamelet.jms-pooled-apache-artemis-sink.password` | `STRING` |
   | `camel-jms-pooled-apache-artemis-source-kafka-connector` | 
`camel.kamelet.jms-pooled-apache-artemis-source.password` | `STRING` |
   | `camel-scp-sink-kafka-connector` | 
`camel.kamelet.scp-sink.privateKeyPassphrase` | `STRING` |
   | `camel-sftp-sink-kafka-connector` | 
`camel.kamelet.sftp-sink.privateKeyPassphrase` | `STRING` |
   | `camel-sftp-source-kafka-connector` | 
`camel.kamelet.sftp-source.privateKeyPassphrase` | `STRING` |
   
   `camel-sftp-sink-kafka-connector` is a good illustration — in the same file, 
`password` is
   `Type.PASSWORD` (line 87) while `privateKeyPassphrase` is `Type.STRING` 
(line 93), although both are
   `format: password` in `sftp-sink.kamelet.yaml`.
   
   These look like generated output that predates the current generator 
behaviour and was never
   regenerated.
   
   ## Expected Behavior
   
   Every connector option whose kamelet declares `format: password` (or whose 
Camel component metadata
   declares `secret: true`) is `ConfigDef.Type.PASSWORD` in the shipped 
`Camel*ConnectorConfig` class,
   so that Kafka Connect applies its usual handling for password-typed 
configuration.
   
   ## Actual Behavior
   
   Five options are `Type.STRING` and therefore do not get that handling, 
inconsistently with the ~270
   equivalent options in the rest of the connector set.
   
   ## Additional Context
   
   Two parts:
   
   1. Correct the five modules listed above.
   2. Close the drift so it cannot recur:
      - the kamelet path decides `PASSWORD` solely on 
`"password".equals(kameletProperty.getFormat())`;
        the catalog's other credential marker, `x-descriptors: 
urn:camel:group:credentials`, is not even
        parsed (`utils/YamlKameletMapper.java` reads only 
`default`/`example`/`description`/`format`/
        `title`/`type`), so a credential property carrying only that descriptor 
is stamped `STRING`;
      - a secret-flagged option with a primitive Java type falls out of the 
`PASSWORD` branch entirely
        via `PRIMITIVE_TYPES_TO_KAFKA_CONFIG_DEF_MAP.getOrDefault`;
      - nothing in the build fails when the checked-in generated tree diverges 
from what the generator
        would produce today.
   
      A build/CI check that regenerates and fails on drift would catch all 
three.


-- 
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