Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

application default credentials don't respect CLOUDSDK_CONFIG #151

Closed
skelterjohn opened this issue Mar 27, 2015 · 5 comments · Fixed by #162
Closed

application default credentials don't respect CLOUDSDK_CONFIG #151

skelterjohn opened this issue Mar 27, 2015 · 5 comments · Fixed by #162

Comments

@skelterjohn
Copy link
Contributor

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.

@skelterjohn
Copy link
Contributor Author

At the very least, it should ensure that directory exists before writing. This bug was discovered by the ADCs failing to write.

@anthmgoogle
Copy link

#154 is a dupe of this:

https://feedback.corp.google.com/#/Report/5019840888

Description:
"gcloud auth login" fails due to .config/gcloud directory not existing

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.

@dhermes
Copy link
Contributor

dhermes commented Apr 10, 2015

I can fix this. Drafting PR now.

dhermes added a commit to dhermes/oauth2client that referenced this issue Apr 10, 2015
Also raising exception if the directory does not exist.

Fixes googleapis#151.
@dhermes
Copy link
Contributor

dhermes commented Apr 10, 2015

#162 sent

I debated adding a call to os.mkdir but I think that's better left to the gcloud CLI or the user that has set $CLOUDSDK_CONFIG manually.

dhermes added a commit to dhermes/oauth2client that referenced this issue Apr 13, 2015
Also raising exception if the directory does not exist.

Fixes googleapis#151.
@dhermes
Copy link
Contributor

dhermes commented Apr 29, 2015

@anthmgoogle I've got a fix ready in #162. Any issues with it?

craigcitro added a commit to craigcitro/oauth2client that referenced this issue May 14, 2015
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.
craigcitro added a commit to craigcitro/oauth2client that referenced this issue May 14, 2015
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants