-
Notifications
You must be signed in to change notification settings - Fork 4
jir-ogc #556
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
jir-ogc #556
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -69,8 +69,9 @@ def asyncify_connection(): | |||||||||||||||
|
|
||||||||||||||||
| instance_name = os.environ.get("CLOUD_SQL_INSTANCE_NAME") | ||||||||||||||||
| user = os.environ.get("CLOUD_SQL_USER") | ||||||||||||||||
| password = os.environ.get("CLOUD_SQL_PASSWORD") | ||||||||||||||||
| database = os.environ.get("CLOUD_SQL_DATABASE") | ||||||||||||||||
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", True) | ||||||||||||||||
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", False) | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Changing Useful? React with 👍 / 👎.
|
||||||||||||||||
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", False) | |
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", password is None) |
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use_iam_auth is False, connect_kwargs["password"] is set from CLOUD_SQL_PASSWORD without any validation. When CLOUD_SQL_PASSWORD is unset/empty, this will fail later with a driver/connector error that’s hard to diagnose. Add an explicit check and raise a clear RuntimeError when password-based auth is selected but CLOUD_SQL_PASSWORD is missing.
| else: | |
| else: | |
| if not password: | |
| raise RuntimeError( | |
| "CLOUD_SQL_PASSWORD must be set and non-empty when " | |
| "CLOUD_SQL_IAM_AUTH is disabled (password-based auth)." | |
| ) |
Copilot
AI
Feb 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use_iam_auth is False, connect_kwargs["password"] is set from CLOUD_SQL_PASSWORD without validation. Add a clear error when password-based auth is selected but CLOUD_SQL_PASSWORD is missing/blank to avoid opaque connector failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If use_iam_auth is False, password-based auth is used but there’s no validation that CLOUD_SQL_PASSWORD is set. Add an explicit check with a clear error when password is missing/blank to prevent hard-to-debug connector failures.