dataform-co / dataform

Dataform is a framework for managing SQL based data operations in BigQuery
https://cloud.google.com/dataform/docs
Apache License 2.0
850 stars 162 forks source link

Support BigQuery oauth credentials #233

Open lewish opened 5 years ago

lewish commented 5 years ago

Currently BigQuery can only be authorized through a service account, which adds significant overhead to setting up a BQ project.

It should be possible to provide oauth credentials when executing against BigQuery.

dorzey commented 5 years ago

👍 we would definitely like to have this

thinhha commented 3 years ago

Downloading service account keys is not very good security practice. The better approach is to use OAUTH as described in this article: https://medium.com/@jryancanty/stop-downloading-google-cloud-service-account-keys-1811d44a97d9

One way to do this is to use GOOGLE_APPLICATION_CREDENTIALS as described in: https://github.com/dataform-co/dataform/issues/1164

Another way is for Dataform to expect a short-lived OAuth 2.0 access token, either as input to the CLI or from an environment variable like as done by terraform: https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#access_token

jamiekt commented 3 years ago

I wholeheartedly agree with @thinhha , access tokens would be an ideal mechanism here.

jamiekt commented 3 years ago

This is a very relevant reference: https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials

thinhha commented 3 years ago

more details on how DBT did this here: https://github.com/fishtown-analytics/dbt/issues/2672