You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "david-streamlio (via GitHub)" <gi...@apache.org> on 2026/08/17 22:17:04 UTC

[PR] [feat][io] Cassandra sink: support authenticated clusters [pulsar-connectors]

david-streamlio opened a new pull request, #136:
URL: https://github.com/apache/pulsar-connectors/pull/136

   ### Motivation
   
   The Cassandra sink cannot connect to a cluster that requires authentication.
   `CassandraSinkConfig` has no credential fields and `CassandraAbstractSink`
   builds its `Cluster` with contact points only:
   
       Cluster.Builder b = Cluster.builder();
       ...
       cluster = b.withoutJMXReporting().build();
   
   Any cluster running `PasswordAuthenticator` — which is the normal production
   setting — is therefore unusable with this connector, with no workaround short
   of forking it.
   
   This gap was first reported in apache/pulsar#16179 (June 2022), which bundled
   the fix with a larger schema-mapping feature. That PR could not be rebased
   after PIP-465 moved the connectors out of the core repo, and the
   authentication half stands on its own, so it is split out here.
   
   ### Modifications
   
   - `CassandraSinkConfig` gains `userName` and `password`, both optional and
     `sensitive = true`. No existing field is changed.
   - `CassandraAbstractSink.createClient` calls `withCredentials(...)` only when
     both are supplied, so an unset pair leaves the connection exactly as it was.
   - `open()` loads config through `IOConfigUtils.loadWithSecrets` instead of
     `CassandraSinkConfig.load`, so the password can be supplied as a Pulsar
     secret rather than sitting in plaintext config. This is the same helper the
     kinesis, redis, canal and azure-data-explorer connectors already use. Fields
     with no secret configured still come from the config map; the pre-existing
     `CassandraStringSinkTest`, which opens the sink with a mocked `SinkContext`,
     passes unchanged and covers that.
   
   The sink's write path, the `cassandra` connector registration and
   `CassandraStringSink` are untouched.
   
   ### Verifying this change
   
   `:cassandra:check` passes. `CassandraSinkAuthTest` adds four cases: credentials
   survive config loading, they are null when unconfigured, and the sink writes
   successfully both with and without them.
   
   Stated plainly, those do not prove the server rejects an unauthenticated
   connection: the test container runs the default `AllowAllAuthenticator`, and
   switching it to `PasswordAuthenticator` needs a full version-specific
   `cassandra.yaml` override. Enforcement is the server's behaviour; what is this
   connector's to get right is that credentials reach the driver and that an unset
   pair changes nothing. Happy to add a container with authentication enabled if
   reviewers would rather have it.
   
   ### Does this pull request potentially affect one of the following parts:
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [x] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [x] Anything that affects deployment
   
   **The default values of configurations**: ticked for visibility. No existing
   default changes — two new keys are added, both defaulting to unset, where unset
   means exactly today's behaviour.
   
   **Deployment**: the module gains `pulsar-io-common`, already in the version
   catalog and used by several other connectors. Nothing changes for a deployment
   that does not set the new keys.
   
   ### Documentation
   
   - [ ] `doc-required`
   - [x] `doc-not-needed`
   - [ ] `doc`
   - [ ] `doc-complete`
   
   The new settings are described by their `@FieldDoc` help text.
   
   


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [feat][io] Cassandra sink: support authenticated clusters [pulsar-connectors]

Posted by "david-streamlio (via GitHub)" <gi...@apache.org>.
david-streamlio merged PR #136:
URL: https://github.com/apache/pulsar-connectors/pull/136


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org