Skip to content

Commit

Permalink
fix: disable self signed jwt (#1566)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arithmetic1728 committed Oct 12, 2021
1 parent 9d1fa42 commit 623a71e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions googleapiclient/discovery.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_discovery.py
Expand Up @@ -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/")

Expand All @@ -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()

Expand Down

0 comments on commit 623a71e

Please sign in to comment.