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

Don't restrict server authenticator in PasswordAuthenticator #1801

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

tolbertam
Copy link
Contributor

Currently gocql will only allow authenticating with authenticators defined in defaultApprovedAuthenticators in conn.go.

There have been multiple occurrences of implementers needing to update this list, either when a vendor would like to add their authenticator, or a new authenticator being added.

It would probably reduce friction to just accept any authenticator provided by the server. From what I know, other drivers behave in this way.

If a user wanted to restrict this, they could use the existing configuration PasswordAuthenticator.AllowedAuthenticators.

patch by Andy Tolbert; reviewed by for CASSANDRA-19859


This is an alternative pr to #1800; since this is a behavioral change, it merits some discussion and may take longer to review.

Currently gocql will only allow authenticating with authenticators
defined in defaultApprovedAuthenticators in conn.go.

There have been multiple occurrences of implementers needing to update
this list, either when a vendor would like to add their authenticator,
or a new authenticator being added.

It would probably reduce friction to just accept any authenticator
provided by the server. From what I know, other drivers behave in this
way.

If a user wanted to restrict this, they could use the existing
configuration PasswordAuthenticator.AllowedAuthenticators.

patch by Andy Tolbert; reviewed by for CASSANDRA-19859

// approve the authenticator with the list of allowed authenticators or default list if approvedAuthenticators is empty.
// approve the authenticator with the list of allowed authenticators. If the provided list is empty,
// the given authenticator is allowed.
func approve(authenticator string, approvedAuthenticators []string) bool {
if len(approvedAuthenticators) == 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, could test for nil, but felt would keep it this way for consistency.

Copy link
Member

@lukasz-antoniak lukasz-antoniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Indeed Java driver does not assert on authenticator returned by the server, but relies on client configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants