From 371b57c44392cfa51cc4a6a09194262a83725a75 Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Fri, 8 May 2020 09:58:04 -0700 Subject: [PATCH 1/3] test: fix usage of tick function so g3 tests can pass (#507) --- tests/transport/test_requests.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/transport/test_requests.py b/tests/transport/test_requests.py index d24b6f644..ed388d479 100644 --- a/tests/transport/test_requests.py +++ b/tests/transport/test_requests.py @@ -268,7 +268,9 @@ def test_request_refresh(self): assert adapter.requests[1].headers["authorization"] == "token1" def test_request_max_allowed_time_timeout_error(self, frozen_time): - tick_one_second = functools.partial(frozen_time.tick, delta=1.0) + tick_one_second = functools.partial( + frozen_time.tick, delta=datetime.timedelta(seconds=1.0) + ) credentials = mock.Mock( wraps=TimeTickCredentialsStub(time_tick=tick_one_second) @@ -286,7 +288,9 @@ def test_request_max_allowed_time_timeout_error(self, frozen_time): authed_session.request("GET", self.TEST_URL, max_allowed_time=0.9) def test_request_max_allowed_time_w_transport_timeout_no_error(self, frozen_time): - tick_one_second = functools.partial(frozen_time.tick, delta=1.0) + tick_one_second = functools.partial( + frozen_time.tick, delta=datetime.timedelta(seconds=1.0) + ) credentials = mock.Mock( wraps=TimeTickCredentialsStub(time_tick=tick_one_second) @@ -308,7 +312,9 @@ def test_request_max_allowed_time_w_transport_timeout_no_error(self, frozen_time authed_session.request("GET", self.TEST_URL, timeout=0.5, max_allowed_time=3.1) def test_request_max_allowed_time_w_refresh_timeout_no_error(self, frozen_time): - tick_one_second = functools.partial(frozen_time.tick, delta=1.0) + tick_one_second = functools.partial( + frozen_time.tick, delta=datetime.timedelta(seconds=1.0) + ) credentials = mock.Mock( wraps=TimeTickCredentialsStub(time_tick=tick_one_second) @@ -333,7 +339,9 @@ def test_request_max_allowed_time_w_refresh_timeout_no_error(self, frozen_time): authed_session.request("GET", self.TEST_URL, timeout=60, max_allowed_time=3.1) def test_request_timeout_w_refresh_timeout_timeout_error(self, frozen_time): - tick_one_second = functools.partial(frozen_time.tick, delta=1.0) + tick_one_second = functools.partial( + frozen_time.tick, delta=datetime.timedelta(seconds=1.0) + ) credentials = mock.Mock( wraps=TimeTickCredentialsStub(time_tick=tick_one_second) From 3d672e9cddd9e8c4946290ab9f90ca9009b8be69 Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Mon, 11 May 2020 14:22:32 -0700 Subject: [PATCH 2/3] fix: catch exceptions.RefreshError (#508) --- google/oauth2/id_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/oauth2/id_token.py b/google/oauth2/id_token.py index f559c6c39..e78add417 100644 --- a/google/oauth2/id_token.py +++ b/google/oauth2/id_token.py @@ -212,7 +212,7 @@ def fetch_id_token(request, audience): ) credentials.refresh(request) return credentials.token - except (ImportError, exceptions.TransportError): + except (ImportError, exceptions.TransportError, exceptions.RefreshError): pass # 2. Try to use service account credentials to get ID token. From 5d86b72e7a26aee2ff635810668c1c4792edd974 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 11 May 2020 14:34:48 -0700 Subject: [PATCH 3/3] chore: release 1.14.3 (#509) * updated CHANGELOG.md [ci skip] * updated setup.cfg [ci skip] * updated setup.py [ci skip] Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84f25baba..b2ca9ac11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-auth/#history +### [1.14.3](https://www.github.com/googleapis/google-auth-library-python/compare/v1.14.2...v1.14.3) (2020-05-11) + + +### Bug Fixes + +* catch exceptions.RefreshError ([#508](https://www.github.com/googleapis/google-auth-library-python/issues/508)) ([3d672e9](https://www.github.com/googleapis/google-auth-library-python/commit/3d672e9cddd9e8c4946290ab9f90ca9009b8be69)) + ### [1.14.2](https://www.github.com/googleapis/google-auth-library-python/compare/v1.14.1...v1.14.2) (2020-05-07) diff --git a/setup.py b/setup.py index 83075ecfa..2835f886b 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ with io.open("README.rst", "r") as fh: long_description = fh.read() -version = "1.14.2" +version = "1.14.3" setup( name="google-auth",