From 623a71e73d33b8474eea20e800c01d0f80dc8b81 Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:08:17 -0700 Subject: [PATCH] fix: disable self signed jwt (#1566) disable self signed jwt since apiary clients mixed cloud and non-cloud apis. To enable self signed jwt, users can set `always_use_jwt_access` to True in `build` method. --- googleapiclient/discovery.py | 4 ++-- tests/test_discovery.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/googleapiclient/discovery.py b/googleapiclient/discovery.py index 1004f308880..8fc66f251e3 100644 --- a/googleapiclient/discovery.py +++ b/googleapiclient/discovery.py @@ -189,7 +189,7 @@ def build( adc_key_path=None, num_retries=1, static_discovery=None, - always_use_jwt_access=True, + always_use_jwt_access=False, ): """Construct a Resource for interacting with an API. @@ -447,7 +447,7 @@ def build_from_document( client_options=None, adc_cert_path=None, adc_key_path=None, - always_use_jwt_access=True, + always_use_jwt_access=False, ): """Create a Resource for interacting with an API. diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 9559bf6817c..bdc180bbb85 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -695,6 +695,7 @@ def test_self_signed_jwt_enabled(self): build_from_document( discovery, credentials=creds, + always_use_jwt_access=True, ) _create_self_signed_jwt.assert_called_with("https://logging.googleapis.com/") @@ -708,7 +709,6 @@ def test_self_signed_jwt_disabled(self): build_from_document( discovery, credentials=creds, - always_use_jwt_access=False, ) _create_self_signed_jwt.assert_not_called()