Skip to content

Conversation

@enocom
Copy link
Member

@enocom enocom commented Aug 23, 2025

This commit ensures conflicting credential options result in a user-facing error.

This commit moves all the dialer config initialization into a single function in options.go. This will help the migration to supporting auth.Credentials and makes the relationship between all the options clear. Previously, there was a mix of option functions setting various fields, possibly returning errors, and the dialer initializer doing additional configuration work. This made it hard to understand how the different credential options related to one another and hid the bug of allowing callers to set conflicting options.

In addition, this commit adds end to end tests to verify the credential-related options work as intended. This is a belated port of GoogleCloudPlatform/cloud-sql-go-connector#460.

Related to #646

@enocom enocom force-pushed the config-cleanup branch 3 times, most recently from 5f5c64c to bb571a3 Compare August 23, 2025 19:19
@enocom enocom marked this pull request as ready for review August 25, 2025 15:47
@enocom enocom requested a review from a team as a code owner August 25, 2025 15:47
Copy link
Collaborator

@nancynh nancynh left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

This commit ensures conflicting credential options result in a
user-facing error.

This commit moves all the dialer config initialization into a single
function in options.go. This will help the migration to supporting
auth.Credentials and makes the relationship between all the options
clear. Previously, there was a mix of option functions setting various
fields, possibly returning errors, and the dialer initializer doing
additional configuration work. This made it hard to understand how the
different credential options related to one another and hid the bug of
allowing callers to set conflicting options.

In addition, this commit adds end to end tests to verify the
credential-related options work as intended. This is a belated port of
GoogleCloudPlatform/cloud-sql-go-connector#460.

Related to #646
@enocom enocom merged commit bb3dc3a into main Aug 26, 2025
16 checks passed
@enocom enocom deleted the config-cleanup branch August 26, 2025 15:21
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