Repository: googleapis/google-auth-library-python

Issue:
Set the default request timeout to something other than `None`
The [AuthorizedSession.requests()](https://github.com/googleapis/google-auth-library-python/blob/1b9de8dfbe4523f3170e47985ab523cb7865de48/google/auth/transport/requests.py#L242-L251) method does not specify a default timeout.

Since production code would almost always want to have some sort of a timeout, let's add one. The libraries that rely on `google-auth`, but do (yet) not specify a timeout themselves, would benefit from that.

Example: [storage issue](https://github.com/googleapis/google-cloud-python/issues/10182)


Discussion:
plamut: Well go figure, running the `blacken` session can cause syntax errors, because a trailing comma is not allowed after **kwargs in Python <= 3.5. :smile: 

Patch:
diff --git a/google/auth/transport/requests.py b/google/auth/transport/requests.py
index ce78e63..1c709d4 100644
--- a/google/auth/transport/requests.py
+++ b/google/auth/transport/requests.py
@@ -42,6 +42,8 @@ from google.auth import transport
 
 _LOGGER = logging.getLogger(__name__)
 
+_DEFAULT_TIMEOUT = 120  # in seconds
+
 
 class _Response(transport.Response):
     """Requests transport response adapter.
@@ -141,7 +143,13 @@ class Request(transport.Request):
         self.session = session
 
     def __call__(
-        self, url, method="GET", body=None, headers=None, timeout=120, **kwargs
+        self,
+        url,
+        method="GET",
+        body=None,
+        headers=None,
+        timeout=_DEFAULT_TIMEOUT,
+        **kwargs
     ):
         """Make an HTTP request using requests.
 
@@ -246,7 +254,7 @@ class AuthorizedSession(requests.Session):
         data=None,
         headers=None,
         max_allowed_time=None,
-        timeout=None,
+        timeout=_DEFAULT_TIMEOUT,
         **kwargs
     ):
         """Implementation of Requests' request.


Test patch:
diff --git a/tests/transport/test_requests.py b/tests/transport/test_requests.py
index 8f73d4b..f0321c8 100644
--- a/tests/transport/test_requests.py
+++ b/tests/transport/test_requests.py
@@ -177,6 +177,21 @@ class TestAuthorizedHttp(object):
 
         assert authed_session._auth_request == auth_request
 
+    def test_request_default_timeout(self):
+        credentials = mock.Mock(wraps=CredentialsStub())
+        response = make_response()
+        adapter = AdapterStub([response])
+
+        authed_session = google.auth.transport.requests.AuthorizedSession(credentials)
+        authed_session.mount(self.TEST_URL, adapter)
+
+        patcher = mock.patch("google.auth.transport.requests.requests.Session.request")
+        with patcher as patched_request:
+            authed_session.request("GET", self.TEST_URL)
+
+        expected_timeout = google.auth.transport.requests._DEFAULT_TIMEOUT
+        assert patched_request.call_args.kwargs.get("timeout") == expected_timeout
+
     def test_request_no_refresh(self):
         credentials = mock.Mock(wraps=CredentialsStub())
         response = make_response()