shahar1 commented on code in PR #59535:
URL: https://github.com/apache/airflow/pull/59535#discussion_r2754415745


##########
providers/google/src/airflow/providers/google/cloud/hooks/cloud_sql.py:
##########
@@ -597,10 +597,14 @@ def _get_sql_proxy_download_url(self):
         return download_url
 
     def _get_credential_parameters(self) -> list[str]:
-        extras = 
GoogleBaseHook.get_connection(conn_id=self.gcp_conn_id).extra_dejson
+        connection = GoogleBaseHook.get_connection(conn_id=self.gcp_conn_id)
+        extras = connection.extra_dejson
         key_path = get_field(extras, "key_path")
         keyfile_dict = get_field(extras, "keyfile_dict")
-        if key_path:
+        if connection.login:
+            # if the connection already has an associated user account, then 
we can use auto auth
+            credential_params = ["--auto-iam-authn", self.gcp_conn_id]

Review Comment:
   It makes sense, thanks for your input Maksim!
   
   @FoxHelms could you please consider the version handling in your changes as 
well?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to