Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Add ssl and auth connection options #367

Merged
merged 2 commits into from
Nov 3, 2016
Merged

Add ssl and auth connection options #367

merged 2 commits into from
Nov 3, 2016

Conversation

pkalemba
Copy link

@pkalemba pkalemba commented Nov 2, 2016

Added a few new options such as authorization of user and ssl connection

Copy link
Contributor

@Dieterbe Dieterbe left a comment

Choose a reason for hiding this comment

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

Hey Pawel, this looks good overall. There's just some various small changes to make it better. Also can you run gofmt -w <filename> on all files you edited, that will make sure indentation and such is correct. thanks!

cluster := gocql.NewCluster(strings.Split(addrs, ",")...)
if ssl == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

can just put if ssl { here

EnableHostVerification: false,
}
}
if auth == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

if auth { will do

keyspace string
hosts string
CaPath string
Username string
Password string
Copy link
Contributor

Choose a reason for hiding this comment

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

all these variables should be un-exported, i.e. start with a lower case letter.
(Enabled is an exception because it is read from the main package)

@@ -84,6 +94,19 @@ func New() *CasIdx {
cluster.Timeout = timeout
cluster.NumConns = numConns
cluster.ProtoVersion = protoVer
if Ssl == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

if ssl { will work

EnableHostVerification: false,
}
}
if Auth == true {
Copy link
Contributor

Choose a reason for hiding this comment

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

if auth {

if Ssl == true {
cluster.SslOpts = &gocql.SslOptions {
CaPath: CaPath,
EnableHostVerification: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

let's turn this into a configurable option, hostVerification because people will want to control this behavior (no need for "enable..." that's implied)

if ssl == true {
cluster.SslOpts = &gocql.SslOptions {
CaPath: CaPath,
EnableHostVerification: false,
Copy link
Contributor

@Dieterbe Dieterbe Nov 2, 2016

Choose a reason for hiding this comment

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

let's turn this into a configurable option, hostVerification because people will want to control this behavior (no need for "enable..." that's implied)

@Dieterbe
Copy link
Contributor

Dieterbe commented Nov 3, 2016

looks good, thanks!

@Dieterbe Dieterbe merged commit 294f42d into grafana:master Nov 3, 2016
@Dieterbe
Copy link
Contributor

Dieterbe commented Nov 3, 2016

@Samaelson FYI i just pushed some cleanups, and some of the option names have changed a bit. now we also have adjusted config files in our packages and updated documentation

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

Successfully merging this pull request may close these issues.

2 participants