Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 38a1792

Browse files
committed
fix: disable logging response body for async logs
1 parent 0bebddd commit 38a1792

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

google/auth/aio/_helpers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,10 @@ async def response_log_async(logger: logging.Logger, response: Any) -> None:
5353
response: The HTTP response object to log.
5454
"""
5555
if _helpers.is_logging_enabled(logger):
56-
json_response = await _parse_response_async(response)
56+
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1755):
57+
# Parsing the response for async streaming logging results in
58+
# the stream to be empty downstream. For now, we will not be logging
59+
# the response for async responses until we investigate further.
60+
# json_response = await _parse_response_async(response)
61+
json_response = None
5762
_helpers._response_log_base(logger, json_response)

tests/aio/test__helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def json(self):
7575
assert len(caplog.records) == 1
7676
record = caplog.records[0]
7777
assert record.message == "Response received..."
78-
assert record.httpResponse == {"key1": "value1", "key2": "value2", "key3": "value3"}
78+
assert record.httpResponse == "<class 'NoneType'>"
7979

8080

8181
@pytest.mark.asyncio

0 commit comments

Comments
 (0)