You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Dan Huang (Jira)" <ji...@apache.org> on 2019/10/29 08:23:00 UTC

[jira] [Updated] (AIRFLOW-5801) CloudSqlProxyRunner always assumes GCP credentials are passed via file instead of JSON blob

     [ https://issues.apache.org/jira/browse/AIRFLOW-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Huang updated AIRFLOW-5801:
-------------------------------
    Description: 
See:
 * [https://github.com/apache/airflow/blob/fc4aa041b0f944d3b1f1b2d045a0518827f054a2/airflow/gcp/hooks/cloud_sql.py#L512]
 * [https://github.com/apache/airflow/blob/1.10.5/airflow/contrib/hooks/gcp_sql_hook.py#L488]

 

Very quick fix here is to replace

 
{code:java}
if GCP_CREDENTIALS_KEY_PATH in connection.extra_dejson:
{code}
with

 
{code:java}
if connection.extra_dejson.get(GCP_CREDENTIALS_KEY_PATH):{code}
And similarly for the lines below.

But perhaps falsy values for connection keys should just be scrubbed?

  was:
See: [https://github.com/apache/airflow/blob/fc4aa041b0f944d3b1f1b2d045a0518827f054a2/airflow/gcp/hooks/cloud_sql.py#L512]

Very quick fix here is to replace

 
{code:java}
if GCP_CREDENTIALS_KEY_PATH in connection.extra_dejson:
{code}
with

 
{code:java}
if connection.extra_dejson.get(GCP_CREDENTIALS_KEY_PATH):{code}
And similarly for the lines below.

But perhaps falsy values for connection keys should just be scrubbed?


> CloudSqlProxyRunner always assumes GCP credentials are passed via file instead of JSON blob
> -------------------------------------------------------------------------------------------
>
>                 Key: AIRFLOW-5801
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5801
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: gcp
>    Affects Versions: 1.10.5
>            Reporter: Dan Huang
>            Priority: Major
>
> See:
>  * [https://github.com/apache/airflow/blob/fc4aa041b0f944d3b1f1b2d045a0518827f054a2/airflow/gcp/hooks/cloud_sql.py#L512]
>  * [https://github.com/apache/airflow/blob/1.10.5/airflow/contrib/hooks/gcp_sql_hook.py#L488]
>  
> Very quick fix here is to replace
>  
> {code:java}
> if GCP_CREDENTIALS_KEY_PATH in connection.extra_dejson:
> {code}
> with
>  
> {code:java}
> if connection.extra_dejson.get(GCP_CREDENTIALS_KEY_PATH):{code}
> And similarly for the lines below.
> But perhaps falsy values for connection keys should just be scrubbed?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)