-
Notifications
You must be signed in to change notification settings - Fork 4
jir-ogc #553
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 #553
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,6 @@ | |||||||||||||||
| # limitations under the License. | ||||||||||||||||
| # =============================================================================== | ||||||||||||||||
|
|
||||||||||||||||
| import asyncio | ||||||||||||||||
| import copy | ||||||||||||||||
| import getpass | ||||||||||||||||
| import os | ||||||||||||||||
|
|
@@ -24,7 +23,7 @@ | |||||||||||||||
| from sqlalchemy import ( | ||||||||||||||||
| create_engine, | ||||||||||||||||
| ) | ||||||||||||||||
| from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine | ||||||||||||||||
| from sqlalchemy.ext.asyncio import create_async_engine | ||||||||||||||||
|
||||||||||||||||
| from sqlalchemy.orm import ( | ||||||||||||||||
| sessionmaker, | ||||||||||||||||
| ) | ||||||||||||||||
|
|
@@ -72,7 +71,7 @@ def asyncify_connection(): | |||||||||||||||
| 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", False) | ||||||||||||||||
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", True) | ||||||||||||||||
|
||||||||||||||||
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", True) | |
| if "CLOUD_SQL_IAM_AUTH" in os.environ: | |
| # Honor explicit configuration of IAM auth. | |
| use_iam_auth = get_bool_env("CLOUD_SQL_IAM_AUTH", False) | |
| else: | |
| # Derive a safe default: prefer password auth when a password is set. | |
| use_iam_auth = False if password else True |
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.
Same concern here: defaulting CLOUD_SQL_IAM_AUTH to True can silently switch Cloud SQL connections to IAM auth when the env var is omitted, breaking password-auth deployments. Please make this explicit (env var required) or implement a safe default/fallback strategy.
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.
Same as above in the online migration path: switching CLOUD_SQL_IAM_AUTH default to True can break environments that previously relied on password auth without explicitly setting the flag. Consider requiring explicit configuration or a safer default/fallback.