Add support for default credentials.#4
Closed
orestica wants to merge 11 commits into
Closed
Conversation
added 4 commits
April 29, 2014 12:11
googleapi.discovery.build().
createdScoped()->create_scoped().
requires no authorization.
added 4 commits
May 12, 2014 13:41
…in for building a service that does not require authentication. The expected behavior of the default credentials for such services is to do nothing.
build(credentials).
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Contributor
|
One or two small notes, otherwise looks good -- we'll merge this when we merge the |
added 3 commits
May 29, 2014 09:28
Credentials are required for building a service.
Contributor
|
Closing, was merged in #10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request goes hand in hand with the following pull request: googleapis/oauth2client#6
Once these two pull requests are accepted and integrated into their respective repositories, a Google API call will be authenticated as simple as building the service like this:
service = build("compute", "v1", credential=GoogleCredential.get_default_credential())
This will work when the code is being run on a VM inside Google Compute Engine, a Google App Engine application or on any other off-fabric platform (in this last case, a credentials file needs to be put together containing either user or service account credentials and an environment variable pointed to it OR a 'gcloud auth login' command needs to be run before using the default credentials).