Skip to content

Commit

Permalink
Fix: Async certificate retrieving (#1101)
Browse files Browse the repository at this point in the history
* fix: Handle certificate retrieving in a more proper way
  • Loading branch information
tivaliy committed Aug 18, 2022
1 parent 26f5c11 commit 05f125d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions google/oauth2/_id_token_async.py
Expand Up @@ -93,9 +93,9 @@ async def _fetch_certs(request, certs_url):
"Could not fetch certificates at {}".format(certs_url)
)

data = await response.data.read()
data = await response.content()

return json.loads(data.decode("utf-8"))
return json.loads(data)


async def verify_token(
Expand Down
Binary file modified system_tests/secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion tests_async/oauth2/test_id_token.py
Expand Up @@ -33,7 +33,7 @@ def make_request(status, data=None):

if data is not None:
response.data = mock.AsyncMock(spec=["__call__", "read"])
response.data.read = mock.AsyncMock(
response.content = mock.AsyncMock(
spec=["__call__"], return_value=json.dumps(data).encode("utf-8")
)

Expand Down

0 comments on commit 05f125d

Please sign in to comment.