From 80d4c3ade761f7dbb1edda6aa3605f581a15a653 Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Fri, 3 Jun 2016 09:25:42 -0700 Subject: [PATCH] Fix an ADC-related bug, and make an install tweak. When getting the application default credentials from a file, we need to make sure we call create_scoped(), otherwise we'll get back invalid access tokens. While I was here, I dropped the hook to add an oauth2l script, since it's now its own package on PyPI. I'll drop the code in a separate PR. --- apitools/base/py/credentials_lib.py | 2 +- setup.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apitools/base/py/credentials_lib.py b/apitools/base/py/credentials_lib.py index ba179608..a3819bc1 100644 --- a/apitools/base/py/credentials_lib.py +++ b/apitools/base/py/credentials_lib.py @@ -642,5 +642,5 @@ def _GetApplicationDefaultCredentials( # ADC will work. cp = 'https://www.googleapis.com/auth/cloud-platform' if not isinstance(credentials, gc) or cp in scopes: - return credentials + return credentials.create_scoped(scopes) return None diff --git a/setup.py b/setup.py index 66696fd8..2ae9e6ba 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,6 @@ CONSOLE_SCRIPTS = [ 'gen_client = apitools.gen.gen_client:main', - 'oauth2l = apitools.scripts.oauth2l:main', ] py_version = platform.python_version()