Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Async certificate retrieving #1101

Merged
merged 6 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/oauth2/_id_token_async.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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