-
Notifications
You must be signed in to change notification settings - Fork 432
application default credentials don't respect CLOUDSDK_CONFIG #151
Comments
At the very least, it should ensure that directory exists before writing. This bug was discovered by the ADCs failing to write. |
#154 is a dupe of this: https://feedback.corp.google.com/#/Report/5019840888 Description: It looks to be a bug that "gcloud auth login" fails when CLOUDSDK_CONFIG is set to non-default location. Either credentials should be stored in the location specified by CLOUDSDK_CONFIG or the parent directories for the default location should be created before attempting to save the credential. The former seems cleaner but there are probably some good reasons behind using a fixed location here. |
I can fix this. Drafting PR now. |
Also raising exception if the directory does not exist. Fixes googleapis#151.
#162 sent I debated adding a call to |
Also raising exception if the directory does not exist. Fixes googleapis#151.
@anthmgoogle I've got a fix ready in #162. Any issues with it? |
As part of googleapis#162, we added a check that the directory containing the well-known file exists. In the case that we're about to write the file, this nicely solves the issue raised in googleapis#151. However, in the case that we're entirely indifferent to the existence of the well-known file, this is an overzealous check. This PR simply tweaks the code to only fail in the case that the directory doesn't exist when writing the well-known file.
As part of googleapis#162, we added a check that the directory containing the well-known file exists. In the case that we're about to write the file, this nicely solves the issue raised in googleapis#151. However, in the case that we're entirely indifferent to the existence of the well-known file, this is an overzealous check. This PR simply tweaks the code to only fail in the case that the directory doesn't exist when writing the well-known file.
application default credentials should either be written to "$CLOUDSDK_CONFIG/application_default_credentials.json", with CLOUDSDK_CONFIG defaulting to "~/.config/gcloud".
gcloud promises that it won't write any credential information outside of $CLOUDSDK_CONFIG.
The text was updated successfully, but these errors were encountered: