This updates the config pipeline with the following changes:
Honor the GOOGLE_APPLICATION_CREDENTIALS environment variable, as specified by the application default credentials protocol. This is checked after the custom :json and :config keys are checked (so those will continue to serve as overrides, preserving previous behavior) but before metadata is checked (per the ADC spec). Note this solves the same issue as (and so may supersede) https://github.com/peburrows/goth/pull/16. It isn't as flexible as #16 in that it does not let the application choose a different environment variable than GOOGLE_APPLICATION_CREDENTIALS, but I don't think that step is necessary. If the maintainer disagrees, configuration of the environment variable can be added back in.
This updates the config pipeline with the following changes:
GOOGLE_APPLICATION_CREDENTIALS
environment variable, as specified by the application default credentials protocol. This is checked after the custom:json
and:config
keys are checked (so those will continue to serve as overrides, preserving previous behavior) but before metadata is checked (per the ADC spec). Note this solves the same issue as (and so may supersede) https://github.com/peburrows/goth/pull/16. It isn't as flexible as #16 in that it does not let the application choose a different environment variable thanGOOGLE_APPLICATION_CREDENTIALS
, but I don't think that step is necessary. If the maintainer disagrees, configuration of the environment variable can be added back in.:project_id
config key, and theGOOGLE_CLOUD_PROJECT
,GCLOUD_PROJECT
, andDEVSHELL_PROJECT_ID
env variables, to serve as overrides for the project ID. Note this reimplements, and thus supersedes, https://github.com/peburrows/goth/pull/20 and it also implements most of https://github.com/peburrows/goth/issues/21Config.init/1
so the precedence logic is more clear.Note this does not implement the entire application default credentials spec. The piece missing is Google Cloud SDK integration.