Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CassandraCqlClusterFactoryBean won't allow configuration of username/password unless authProvider also given. [DATACASS-233] #408

Closed
spring-projects-issues opened this issue Sep 8, 2015 · 6 comments
Assignees
Labels
in: core status: duplicate type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Sep 8, 2015

Adam Brown opened DATACASS-233 and commented

CassandraCqlClusterFactoryBean.afterPropertiesSet() only utilizes the username property when the authProvider property is also set. Looking at the Javadoc for the methods called withAuthProvider() and withCredentials() on Cluster.Builder indicates that you should only ever call one or the other, not both. I suspect that the intended behavior should be something like:

if (authProvider != null) {
  builder.withAuthProvider(authProvider);
} else if (username != null) {
  builder.withCredentials(username, password);
}

but unfortunately, there are no unit tests for this class


Affects: 1.3 GA (Gosling)

Issue Links:

  • DATACASS-263 AuthProvider required when using with username/password
    ("is superseded by")

Referenced from: commits 4fa9273

Backported to: 1.4.2 (Hopper SR2), 1.3.5 (Gosling SR5)

2 votes, 3 watchers

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2015

David Webb commented

If there is a pull request to go along with this, please provide. Thanks

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2015

Adam Brown commented

Sorry, there isn't a pull request since I was primarily looking at the code to understand why the credentials weren't working by themselve

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 22, 2015

David Webb commented

Confirmed functionality in the DSE Driver docs


    withAuthProvider

    public Cluster.Builder withAuthProvider(AuthProvider authProvider)

    Use the specified AuthProvider when connecting to Cassandra hosts.

    Use this method when a custom authentication scheme is in place. You shouldn't call both this method and withCredentials on the same Builder instance as one will supersede the other

    Parameters:
        authProvider - the AuthProvider to use to login to Cassandra hosts.
    Returns:
        this Builder

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 22, 2015

David Webb commented

Added logic to support only one authentication method on the ClusterCqlFactoryBean. This will throw an exception during afterPropertiesSet() if both are defined

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 23, 2015

David Webb commented

Changed rolled back.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 6, 2016

Mark Paluch commented

Fixed this bug with DATACASS-263 as branch DATACASS-233 was not merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: duplicate type: bug
Projects
None yet
Development

No branches or pull requests

2 participants