[
https://issues.apache.org/jira/browse/CALCITE-3907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17079092#comment-17079092
]
Thomas Heinemann commented on CALCITE-3907:
-------------------------------------------
I created a pull request on Github: https://github.com/apache/calcite/pull/1905
I am not entirely sure of how to test this... The existing tests are more
integration test like, so to test the default port constructor we would need to
modify the embedded Cassandra to listen on port 9042, which may cause issues on
hosts where a Cassandra instance is already running.
If you have a preferred way please give me feedback and I will add a test
accordingly :)
> CassandraSchema ignores username and password if no port is specified
> ---------------------------------------------------------------------
>
> Key: CALCITE-3907
> URL: https://issues.apache.org/jira/browse/CALCITE-3907
> Project: Calcite
> Issue Type: Bug
> Components: cassandra-adapter
> Environment: Manjaro Linux with a remote Cassandra
> Reporter: Thomas Heinemann
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The constructor of CassandraSchema which takes username and password
> parameters, but not the port ignores the username and password when
> delegating to the main constructor. Hence, the main constructor tries to
> establish an unauthenticated connection
> h2. Steps to reproduce:
> # Configure a model.json like the following:
> {code:java}
> {
> version: '1.0',
> defaultSchema: 'twissandra',
> schemas: [
> {
> name: 'twissandra',
> type: 'custom',
> factory: 'org.apache.calcite.adapter.cassandra.CassandraSchemaFactory',
> operand: {
> host: 'localhost',
> keyspace: 'twissandra'
> username: 'cassandra'
> password: 'cassandra'
> }
> }
> ]
> }
> {code}
> # Disable unauthenticated connections to the cassandra instance (but make
> sure username and password in the model.json are correct, and that Cassandra
> listens on the default port, i.e. 9042)
> # Use the model.json to connect to your Cassandra instance
> h2. Expected behaviour
> The connection is established using the username and password as given in the
> JSON
> h2. Actual behaviour
> The connection fails, because the connection was tried without using
> authentication
--
This message was sent by Atlassian Jira
(v8.3.4#803005)