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

Add support for custom cassandra authenticators #4676

Conversation

johndelcastillo
Copy link
Contributor

** What changed **
Propagated support for custom authenticators from the gocql driver to the cadence application, this also required updating the version of the gocql driver.

** Why **
Depending on how you configure your Cassandra cluster, it may expose a custom authenticator, which if not expected by the gocql driver, will result in an error and the connection being rejected.

** Verification **
To verify, I updated the cassandra test cluster to use password authentication and introduced a negative unit test to ensure the AllowedAuthenticators config is being passed down to the gocql driver correctly.

Potential risks
gocql driver was updated to the latest via go get, minimal risk should be included there.

Release notes
Added AllowedAuthenticator support in the gocql driver

@CLAassistant
Copy link

CLAassistant commented Dec 10, 2021

CLA assistant check
All committers have signed the CLA.

@@ -0,0 +1,1302 @@

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to not to use this file? I think you only want to change some of the config opts so is that possible to override via other way like env?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I had a look. You can't make this Cassandra docker image (https://hub.docker.com/_/cassandra) work with Auth without updating the yaml.

Its not strictly necessary if we are comfortable not testing the auth path of the gocql client.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah I was about to say the same thing. Let's skip the test for this.
Cadence doesn't have a convention to test every config like those. It's okay not to test because if they don't work, we will know :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, i'll make the updates

// CassandraUsername env
CassandraUsername = "CASSANDRA_DB_USERNAME"
// CassandraUsername env
CassandraDefaultUsername = "cassandra"
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's make it back to empty. It's not just unit test, there are other integ test, pipeline and even dev envs already use empty username/password.

Changing it is going to be painful but unnecessary. I will keep it empty for simple

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: comments smell like copy & paste :)

// CassandraPassword env
CassandraDefaultPassword = "cassandra"
// CassandraPassword env
CassandraAllowedAuthenticators = "CASSANDRA_DB_ALLOWEDAUTHENTICATORS"
Copy link
Collaborator

Choose a reason for hiding this comment

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

CASSANDRA_DB_ALLOWED_AUTHENTICATORS may look better

@longquanzheng longquanzheng enabled auto-merge (squash) December 13, 2021 05:14
@longquanzheng longquanzheng merged commit e0a1d20 into uber:master Dec 13, 2021
@coveralls
Copy link

Pull Request Test Coverage Report for Build f14184ba-5ef7-4af7-9c6f-9ed8c4e9b85a

  • 33 of 45 (73.33%) changed or added relevant lines in 5 files are covered.
  • 54 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.01%) to 56.927%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/nosql/nosqlplugin/cassandra/gocql/client.go 0 3 0.0%
tools/cassandra/handler.go 0 9 0.0%
Files with Coverage Reduction New Missed Lines %
common/persistence/executionManager.go 2 76.57%
common/persistence/statsComputer.go 2 96.43%
common/task/fifoTaskScheduler.go 2 85.57%
common/task/weightedRoundRobinTaskScheduler.go 2 89.12%
service/history/shard/context.go 9 66.22%
service/history/execution/context.go 17 73.96%
common/persistence/nosql/nosqlExecutionStore.go 20 60.35%
Totals Coverage Status
Change from base Build cdc57ec2-655b-475e-9bf9-1650ba0f958e: 0.01%
Covered Lines: 82803
Relevant Lines: 145454

💛 - Coveralls

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.

5 participants