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

(#1163) Initial support for sslmode #1177

Merged
merged 3 commits into from
Apr 3, 2020
Merged

Conversation

BradleyBoutcher
Copy link
Contributor

@BradleyBoutcher BradleyBoutcher commented Mar 31, 2020

What does this PR do (include background context, if relevant)?

Adds sslmode as a param for user configuration and injecting it
into the DSN

What ticket does this PR close?

Connected to #1163

Where should the reviewer start?

internal/plugin/connectors/tcp/mssql/connector.go#dataSourceName

@BradleyBoutcher BradleyBoutcher self-assigned this Mar 31, 2020
@BradleyBoutcher BradleyBoutcher changed the title 1163 Initial support for sslmode (#1163) Initial support for sslmode Mar 31, 2020
Copy link
Contributor

@sgnn7 sgnn7 left a comment

Choose a reason for hiding this comment

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

@BradleyBoutcher One tiny nit comment from me since it seem like @doodlesbykumbi already covered my concerns too in hs review.

go.sum Outdated Show resolved Hide resolved
@BradleyBoutcher BradleyBoutcher force-pushed the 1163-disable-sslmode branch 11 times, most recently from b6c132c to 4c2636a Compare April 2, 2020 18:44
if credentials["sslmode"] == nil {
connDetails.SSLMode = "disable"
} else {
connDetails.SSLMode = string(credentials["sslmode"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is related to the test comments below, but don't we currently only support "disable"? This feels like a reasonable spot to throw an error if a different value is set here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still unclear as to how we'd want to throw errors here, as we only have infrastructure for writing fake mssql errors to the client, and we have avoided throwing secretless specific errors. We discussed adding error handling to this exact method in the past, and decided against it at the time. I'm not against it, I just think it's out of scope for this story.

For now, I set a switch that only accepts "disable", and any other value falls through to the default, which is "disable" currently as well.

@BradleyBoutcher BradleyBoutcher force-pushed the 1163-disable-sslmode branch 4 times, most recently from 159e334 to 4281adf Compare April 3, 2020 15:03
Adds sslmode as a param for user configuration and injecting it
into the DSN
sslmode support added to test configs for secretless and the
associated integration tests
Currently, we only support disabled. A simple check was
added to propogateParams to confirm that the 'disabled'
parameter has been properly set on the server.
Copy link
Contributor

@doodlesbykumbi doodlesbykumbi left a comment

Choose a reason for hiding this comment

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

LGTM! Great work.

I'd also like to highlight (for others) that we spoke briefly about

  1. In the next set of PRs in this epic we'll be cleaning up propagateParams for the integration tests
  2. Kicking off a discussion about when errors about configuration parameters like SSL should be reported to. And if the credentials section really is the best place for for these sort of static parameters.

@doodlesbykumbi doodlesbykumbi merged commit 642c39a into master Apr 3, 2020
@doodlesbykumbi doodlesbykumbi deleted the 1163-disable-sslmode branch April 3, 2020 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants