Repository navigation
Add Cloud SQL IAM database authentication support to CloudSQL MySQL and PostgreSQL plugins - #705
Open
vishwasvaidya-cloudsufi wants to merge 2 commits into
Open
vishwasvaidya-cloudsufi wants to merge 2 commits into
vishwasvaidya-cloudsufi wants to merge 2 commits into
Conversation
…reSQL plugins - Support IAM database authentication (authenticationType=iam, serviceAccountEmail) in CloudSQL MySQL and PostgreSQL Connector, Batch Source, Batch Sink, and Action plugins, defaulting to Basic auth for backward compatibility. - Support both Public instances (Cloud SQL JDBC Socket Factory enableIamAuth + cloudSqlTargetPrincipal impersonation, plus PostgreSQL sslmode=disable via putIfAbsent) and Private instances (Cloud SQL Auth Proxy v2 --auto-iam-authn). - Validate IAM authentication at design time and runtime (post-macro resolution) and make Connector canConnect() authentication-aware. - Update ConnectionConfig / AbstractDBConnectorConfig to use getUser()/getPassword() getters and avoid null password entries in Properties. - Update widget JSONs, plugin documentation, unit tests, and connector integration tests.
There was a problem hiding this comment.
Code Review
This pull request introduces Cloud SQL IAM database authentication support for the CloudSQL MySQL and PostgreSQL plugins, updating configurations, documentation, widgets, and validation logic across actions, sources, sinks, and connectors. Review feedback suggests refining macro validation in CloudSQLUtil to correctly handle resolved macros at runtime, and safely handling potentially null connectionTimeout values in the action configurations to prevent parsing errors.
URLDecoder.decode() changed its NumberFormatException wording in JDK 11
("Error at index 0 in" vs JDK 8 "For input string"). Match the common
URLDecoder prefix so E2E substring verification passes on JDK 11.
vishwasvaidya-cloudsufi
requested review from
sahusanket
and removed request for
sahusanket
December 4, 2026 07:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Cloud SQL IAM database authentication support to CloudSQL MySQL and CloudSQL PostgreSQL plugins (Connector, Batch Source, Batch Sink, and Action) for both Public and Private instances, while defaulting to
Basicauthentication for full backward compatibility.Key Changes
cloudsql-mysql-plugin,cloudsql-postgresql-plugin):authenticationType(basic/iam, defaultbasic) and macro-enabledserviceAccountEmailacross Connector, Source, Sink, and Action configs, widget JSONs (hidingUsername/PasswordwhenIAMis selected), and plugin docs.serviceAccountEmail(before@for MySQL; without.gserviceaccount.comfor PostgreSQL).enableIamAuth=true,cloudSqlTargetPrincipal=<serviceAccountEmail>, placeholder password, and (for PostgreSQL) defaultssslmode=disableviaputIfAbsentto prevent pgjdbc hangs while preserving explicit overrides.--auto-iam-authn).database-commons):CloudSQLUtil(design-time + post-macro runtime validation across Connector, Source, Sink, and Action, plus auth-awarecanConnect()).ConnectionConfig/AbstractDBConnectorConfigto resolvegetUser()/getPassword()via getters and skipnullpasswords inProperties.CloudSQLUtilTest,CloudSQLMySQLIamAuthTest, andCloudSQLPostgreSQLIamAuthTest, and updated connector integration tests for-DauthenticationType=iam.Verification
mvn test -pl database-commons,cloudsql-mysql-plugin,cloudsql-postgresql-plugin— all passed (102/13/14unit tests).CloudSQLMySQLagainst a Private Cloud SQL MySQL 8.4 instance via Cloud SQL Auth Proxy v2 (--private-ip --auto-iam-authn) with no DB password — Connector (test,browse,sample),Source → TrashPreview & full Dataproc batch run (COMPLETED),Action, and negative macro validation all passed.Evidence Screenshot