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

Python Application Default Credentials should checked for GCE environment last #100

Closed
anthmgoogle opened this issue Dec 19, 2014 · 1 comment

Comments

@anthmgoogle
Copy link

The implementation of get_application_default has an issue that it detects the environement before fetching the credentials. However, the check for GCE can hang on certain networks for up to 30 seconds (See #93).
This should be changed to match the Java implementation where this is not queried until the end because of its side effects. This means that the can can only occur in a failure case.

To give a little more detail; the java code roughly says:

if (testForWellKnownFile(...)) {
return credsFromWellKnownFile();
} else if (testForGae(...)) {
return credsFromGae();
} else if (testForGce(...)) {
return credsFromGce();
}

on the flip side, the python code says:

if (well_known_file_exists()):
env = 'WELL_KNOWN_FILE'
elif (detect_gae()):
env = 'GAE'
elif (detect_gce()):
env = 'GCE'
...
return CredsFromEnv(env)

@theacodes
Copy link
Contributor

Thank you for creating this issue, however, this project is deprecatedand we will only be addressing critical security issues. You can read moreabout this deprecation here.

If you need support or help using this library, we recommend that you ask yourquestion on StackOverflow.

If you still think this issue is relevant and should be addressed, pleasecomment and let us know!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants