Add additional BigQuery authentication method#62
Conversation
|
An important thing to note here is by changing the config key name here (from
or
|
1811f21 to
49c6fec
Compare
Something just occurred to me here. What kind of error message will these users see? Can we make sure the error message provides a concrete indication of what they should do to fix the issue? Like if they have BQ as the warehouse type, can we have the error message tell them that they need to fill out the dwh_path_to_creds (and only that key)? This isn't blocking on merge but we should follow up with that improvement before release. |
49c6fec to
88605dc
Compare
Added an error message. So for this specific case of a user using the old config version, they'll see |
Context
Currently, MetricFlow only allows a user to pass in a path to the google JSON credential of a
service accounttype. However, we want to expose another method of authentication. In this PR, it allows a user to authenticate BigQuery through a method called ADC (Application Default Credentials). This way a user can authenticate via their own end user credentials. More information about ADC here (https://google.aip.dev/auth/4110)Changes
dwh_passwordtodwh_pass_to_credsfor clarity purposesdwh_project_idconfig key if a user wants to auth via ADCUsage
Current Service Account Auth (No changes)
Note that
dwh_project_idcan be ignoredAdditional Auth Method
Can be easily done by running
gcloud auth application-default loginon the command line which would create a credential file linked to your specific user to the default location provided by Google. This will then be used automatically when the BQ engine gets created. Then in the config file you will have something like this,Note that
dwh_path_to_credscan be ignoredDisclosure
The recommended way of providing production authentication should be ideally through a service account credential and not an end user credential