Skip to content

mysql: preserve cleartext password auth setting#3738

Open
huynhtrungcip wants to merge 2 commits into
google:masterfrom
huynhtrungcip:fix-mysql-cleartext-auth
Open

mysql: preserve cleartext password auth setting#3738
huynhtrungcip wants to merge 2 commits into
google:masterfrom
huynhtrungcip:fix-mysql-cleartext-auth

Conversation

@huynhtrungcip

@huynhtrungcip huynhtrungcip commented Jul 3, 2026

Copy link
Copy Markdown

Changes

  • Preserve the existing Go CDK default AllowCleartextPasswords behavior for generic mysql:// URLs when the option is omitted.
  • Respect an explicit allowCleartextPasswords=false URL setting instead of overwriting it after DSN parsing.
  • Continue allowing cleartext password authentication in awsmysql, where the connector configures TLS before connecting.
  • Add coverage for default, explicit false, and explicit true allowCleartextPasswords URL settings.

Tests

  • go test ./mysql -run TestConfigFromURL -count=1
  • go test ./mysql ./mysql/awsmysql ./mysql/azuremysql -count=1
  • go test ./mysql/... -count=1
  • go test ./... -count=1

@vangent

vangent commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Can you explain why you think this change is necessary?
Isn't it a breaking change for any non-AWS mysql user that's got a cleartext password but doesn't have it explicitly in the URL?

@huynhtrungcip

Copy link
Copy Markdown
Author

Good point. The previous version would have changed the default behavior for generic mysql:// URLs, so I adjusted the PR to avoid that compatibility break.

The updated patch keeps the existing Go CDK default when allowCleartextPasswords is omitted, but preserves an explicit URL setting such as allowCleartextPasswords=false instead of overwriting it after DSN parsing. awsmysql still sets AllowCleartextPasswords explicitly because that connector configures TLS before connecting.

Rechecked locally:

  • go test ./mysql -run TestConfigFromURL -count=1
  • go test ./mysql ./mysql/awsmysql ./mysql/azuremysql -count=1
  • go test ./mysql/... -count=1
  • go test ./... -count=1

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