{"action":"created","comment":{"url":"https://api.github.com/repos/google/google-api-python-client/pulls/comments/93334940","pull_request_review_id":13860535,"id":93334940,"diff_hunk":"@@ -0,0 +1,90 @@\n+# Copyright 2016 Google Inc. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"Helpers for authentication using oauth2client or google-auth.\"\"\"\n+\n+import httplib2\n+\n+try:\n+    import google.auth\n+    import google_auth_httplib2\n+    HAS_GOOGLE_AUTH = True\n+except ImportError:  # pragma: NO COVER\n+    HAS_GOOGLE_AUTH = False\n+\n+try:\n+    import oauth2client\n+    import oauth2client.client\n+    HAS_OAUTH2CLIENT = True\n+except ImportError:  # pragma: NO COVER\n+    HAS_OAUTH2CLIENT = False\n+\n+\n+def default_credentials():\n+    \"\"\"Returns Application Default Credentials.\"\"\"\n+    if HAS_GOOGLE_AUTH:\n+        credentials, _ = google.auth.default()\n+        return credentials\n+    elif HAS_OAUTH2CLIENT:\n+        return oauth2client.client.GoogleCredentials.get_application_default()\n+    else:\n+        raise EnvironmentError(\n+            'No authentication library is available. Please install either '\n+            'oauth2client or google-auth.')","path":"googleapiclient/_auth.py","position":44,"original_position":44,"commit_id":"87467df3c9d076302fa61d933fcac01eb3f9fce8","original_commit_id":"87467df3c9d076302fa61d933fcac01eb3f9fce8","user":{"login":"jerjou","id":913439,"avatar_url":"https://avatars.githubusercontent.com/u/913439?v=3","gravatar_id":"","url":"https://api.github.com/users/jerjou","html_url":"https://github.com/jerjou","followers_url":"https://api.github.com/users/jerjou/followers","following_url":"https://api.github.com/users/jerjou/following{/other_user}","gists_url":"https://api.github.com/users/jerjou/gists{/gist_id}","starred_url":"https://api.github.com/users/jerjou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerjou/subscriptions","organizations_url":"https://api.github.com/users/jerjou/orgs","repos_url":"https://api.github.com/users/jerjou/repos","events_url":"https://api.github.com/users/jerjou/events{/privacy}","received_events_url":"https://api.github.com/users/jerjou/received_events","type":"User","site_admin":false},"body":"Might want to reorder to mention `google-auth` first, for subtle psychological prodding ;-)","created_at":"2016-12-20T22:01:45Z","updated_at":"2016-12-20T22:01:45Z","html_url":"https://github.com/google/google-api-python-client/pull/319#discussion_r93334940","pull_request_url":"https://api.github.com/repos/google/google-api-python-client/pulls/319","_links":{"self":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/comments/93334940"},"html":{"href":"https://github.com/google/google-api-python-client/pull/319#discussion_r93334940"},"pull_request":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/319"}}},"pull_request":{"url":"https://api.github.com/repos/google/google-api-python-client/pulls/319","id":98832649,"html_url":"https://github.com/google/google-api-python-client/pull/319","diff_url":"https://github.com/google/google-api-python-client/pull/319.diff","patch_url":"https://github.com/google/google-api-python-client/pull/319.patch","issue_url":"https://api.github.com/repos/google/google-api-python-client/issues/319","number":319,"state":"open","locked":false,"title":"Add support for google-auth","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"body":"This also obviates the need to pass credentials into `discovery.build` or `discovery.build_from_document` if you're using ADC. This library can now automatically acquire those.","created_at":"2016-12-20T21:53:53Z","updated_at":"2016-12-20T22:01:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aeff0e37d8597c84dc8587861281660e7bec8b82","assignee":{"login":"bjwatson","id":471755,"avatar_url":"https://avatars.githubusercontent.com/u/471755?v=3","gravatar_id":"","url":"https://api.github.com/users/bjwatson","html_url":"https://github.com/bjwatson","followers_url":"https://api.github.com/users/bjwatson/followers","following_url":"https://api.github.com/users/bjwatson/following{/other_user}","gists_url":"https://api.github.com/users/bjwatson/gists{/gist_id}","starred_url":"https://api.github.com/users/bjwatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjwatson/subscriptions","organizations_url":"https://api.github.com/users/bjwatson/orgs","repos_url":"https://api.github.com/users/bjwatson/repos","events_url":"https://api.github.com/users/bjwatson/events{/privacy}","received_events_url":"https://api.github.com/users/bjwatson/received_events","type":"User","site_admin":false},"assignees":[{"login":"bjwatson","id":471755,"avatar_url":"https://avatars.githubusercontent.com/u/471755?v=3","gravatar_id":"","url":"https://api.github.com/users/bjwatson","html_url":"https://github.com/bjwatson","followers_url":"https://api.github.com/users/bjwatson/followers","following_url":"https://api.github.com/users/bjwatson/following{/other_user}","gists_url":"https://api.github.com/users/bjwatson/gists{/gist_id}","starred_url":"https://api.github.com/users/bjwatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjwatson/subscriptions","organizations_url":"https://api.github.com/users/bjwatson/orgs","repos_url":"https://api.github.com/users/bjwatson/repos","events_url":"https://api.github.com/users/bjwatson/events{/privacy}","received_events_url":"https://api.github.com/users/bjwatson/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/google-api-python-client/pulls/319/commits","review_comments_url":"https://api.github.com/repos/google/google-api-python-client/pulls/319/comments","review_comment_url":"https://api.github.com/repos/google/google-api-python-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/google-api-python-client/issues/319/comments","statuses_url":"https://api.github.com/repos/google/google-api-python-client/statuses/87467df3c9d076302fa61d933fcac01eb3f9fce8","head":{"label":"jonparrott:google-auth","ref":"google-auth","sha":"87467df3c9d076302fa61d933fcac01eb3f9fce8","user":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"repo":{"id":39223590,"name":"google-api-python-client","full_name":"jonparrott/google-api-python-client","owner":{"login":"jonparrott","id":250995,"avatar_url":"https://avatars.githubusercontent.com/u/250995?v=3","gravatar_id":"","url":"https://api.github.com/users/jonparrott","html_url":"https://github.com/jonparrott","followers_url":"https://api.github.com/users/jonparrott/followers","following_url":"https://api.github.com/users/jonparrott/following{/other_user}","gists_url":"https://api.github.com/users/jonparrott/gists{/gist_id}","starred_url":"https://api.github.com/users/jonparrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonparrott/subscriptions","organizations_url":"https://api.github.com/users/jonparrott/orgs","repos_url":"https://api.github.com/users/jonparrott/repos","events_url":"https://api.github.com/users/jonparrott/events{/privacy}","received_events_url":"https://api.github.com/users/jonparrott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jonparrott/google-api-python-client","description":null,"fork":true,"url":"https://api.github.com/repos/jonparrott/google-api-python-client","forks_url":"https://api.github.com/repos/jonparrott/google-api-python-client/forks","keys_url":"https://api.github.com/repos/jonparrott/google-api-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jonparrott/google-api-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jonparrott/google-api-python-client/teams","hooks_url":"https://api.github.com/repos/jonparrott/google-api-python-client/hooks","issue_events_url":"https://api.github.com/repos/jonparrott/google-api-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/jonparrott/google-api-python-client/events","assignees_url":"https://api.github.com/repos/jonparrott/google-api-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/jonparrott/google-api-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/jonparrott/google-api-python-client/tags","blobs_url":"https://api.github.com/repos/jonparrott/google-api-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jonparrott/google-api-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jonparrott/google-api-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jonparrott/google-api-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jonparrott/google-api-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/jonparrott/google-api-python-client/languages","stargazers_url":"https://api.github.com/repos/jonparrott/google-api-python-client/stargazers","contributors_url":"https://api.github.com/repos/jonparrott/google-api-python-client/contributors","subscribers_url":"https://api.github.com/repos/jonparrott/google-api-python-client/subscribers","subscription_url":"https://api.github.com/repos/jonparrott/google-api-python-client/subscription","commits_url":"https://api.github.com/repos/jonparrott/google-api-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jonparrott/google-api-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jonparrott/google-api-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jonparrott/google-api-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/jonparrott/google-api-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/jonparrott/google-api-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jonparrott/google-api-python-client/merges","archive_url":"https://api.github.com/repos/jonparrott/google-api-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jonparrott/google-api-python-client/downloads","issues_url":"https://api.github.com/repos/jonparrott/google-api-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/jonparrott/google-api-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/jonparrott/google-api-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/jonparrott/google-api-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jonparrott/google-api-python-client/labels{/name}","releases_url":"https://api.github.com/repos/jonparrott/google-api-python-client/releases{/id}","deployments_url":"https://api.github.com/repos/jonparrott/google-api-python-client/deployments","created_at":"2015-07-16T22:31:15Z","updated_at":"2015-07-16T22:31:16Z","pushed_at":"2016-12-20T21:52:24Z","git_url":"git://github.com/jonparrott/google-api-python-client.git","ssh_url":"git@github.com:jonparrott/google-api-python-client.git","clone_url":"https://github.com/jonparrott/google-api-python-client.git","svn_url":"https://github.com/jonparrott/google-api-python-client","homepage":null,"size":20239,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"5dcd66cd597f4f833c95a9059a68c5774ff1a82b","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":15749269,"name":"google-api-python-client","full_name":"google/google-api-python-client","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/google-api-python-client","description":null,"fork":false,"url":"https://api.github.com/repos/google/google-api-python-client","forks_url":"https://api.github.com/repos/google/google-api-python-client/forks","keys_url":"https://api.github.com/repos/google/google-api-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/google-api-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/google-api-python-client/teams","hooks_url":"https://api.github.com/repos/google/google-api-python-client/hooks","issue_events_url":"https://api.github.com/repos/google/google-api-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/google/google-api-python-client/events","assignees_url":"https://api.github.com/repos/google/google-api-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/google/google-api-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/google/google-api-python-client/tags","blobs_url":"https://api.github.com/repos/google/google-api-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/google-api-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/google-api-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/google-api-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/google-api-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/google-api-python-client/languages","stargazers_url":"https://api.github.com/repos/google/google-api-python-client/stargazers","contributors_url":"https://api.github.com/repos/google/google-api-python-client/contributors","subscribers_url":"https://api.github.com/repos/google/google-api-python-client/subscribers","subscription_url":"https://api.github.com/repos/google/google-api-python-client/subscription","commits_url":"https://api.github.com/repos/google/google-api-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/google-api-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/google-api-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/google-api-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/google-api-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/google/google-api-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/google-api-python-client/merges","archive_url":"https://api.github.com/repos/google/google-api-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/google-api-python-client/downloads","issues_url":"https://api.github.com/repos/google/google-api-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/google/google-api-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/google-api-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/google-api-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/google-api-python-client/labels{/name}","releases_url":"https://api.github.com/repos/google/google-api-python-client/releases{/id}","deployments_url":"https://api.github.com/repos/google/google-api-python-client/deployments","created_at":"2014-01-08T21:55:56Z","updated_at":"2016-12-20T14:57:25Z","pushed_at":"2016-12-20T21:56:43Z","git_url":"git://github.com/google/google-api-python-client.git","ssh_url":"git@github.com:google/google-api-python-client.git","clone_url":"https://github.com/google/google-api-python-client.git","svn_url":"https://github.com/google/google-api-python-client","homepage":null,"size":26070,"stargazers_count":1308,"watchers_count":1308,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":607,"mirror_url":null,"open_issues_count":90,"forks":607,"open_issues":90,"watchers":1308,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/319"},"html":{"href":"https://github.com/google/google-api-python-client/pull/319"},"issue":{"href":"https://api.github.com/repos/google/google-api-python-client/issues/319"},"comments":{"href":"https://api.github.com/repos/google/google-api-python-client/issues/319/comments"},"review_comments":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/319/comments"},"review_comment":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/319/commits"},"statuses":{"href":"https://api.github.com/repos/google/google-api-python-client/statuses/87467df3c9d076302fa61d933fcac01eb3f9fce8"}}}}
{"actor":{"display_login":"jerjou"}}