From 1dd367d75c5f85aeb890d0fd9c44a62df2aa4704 Mon Sep 17 00:00:00 2001 From: GW Date: Wed, 19 Oct 2022 15:37:45 +0800 Subject: [PATCH 1/3] fix: run_local_server block when waiting for response --- google_auth_oauthlib/flow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/google_auth_oauthlib/flow.py b/google_auth_oauthlib/flow.py index 72cb13f..a3bebe7 100644 --- a/google_auth_oauthlib/flow.py +++ b/google_auth_oauthlib/flow.py @@ -449,6 +449,7 @@ def run_local_server( success_message=_DEFAULT_WEB_SUCCESS_MESSAGE, open_browser=True, redirect_uri_trailing_slash=True, + timeout_seconds=None, **kwargs ): """Run the flow using the server strategy. @@ -503,6 +504,7 @@ def run_local_server( print(authorization_prompt_message.format(url=auth_url)) + local_server.timeout = timeout_seconds local_server.handle_request() # Note: using https here because oauthlib is very picky that From 9f6cb709379a61e7a04b322e8eccd248cc98aebf Mon Sep 17 00:00:00 2001 From: GW Date: Thu, 20 Oct 2022 09:21:34 +0800 Subject: [PATCH 2/3] fix: Add inline documentation --- google_auth_oauthlib/flow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google_auth_oauthlib/flow.py b/google_auth_oauthlib/flow.py index a3bebe7..55714d3 100644 --- a/google_auth_oauthlib/flow.py +++ b/google_auth_oauthlib/flow.py @@ -479,6 +479,9 @@ def run_local_server( in the user's browser. redirect_uri_trailing_slash (bool): whether or not to add trailing slash when constructing the redirect_uri. Default value is True. + timeout_seconds (int): It will raise an error after the timeout timing + if there are no credentials response. The value is in seconds. + Default value is None. kwargs: Additional keyword arguments passed through to :meth:`authorization_url`. From d89dbe91ca003dfe974d0c48f6c01207f472a95c Mon Sep 17 00:00:00 2001 From: GW Date: Thu, 20 Oct 2022 11:20:05 +0800 Subject: [PATCH 3/3] fix: lint --- google_auth_oauthlib/flow.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/google_auth_oauthlib/flow.py b/google_auth_oauthlib/flow.py index 55714d3..1a84d9b 100644 --- a/google_auth_oauthlib/flow.py +++ b/google_auth_oauthlib/flow.py @@ -479,8 +479,9 @@ def run_local_server( in the user's browser. redirect_uri_trailing_slash (bool): whether or not to add trailing slash when constructing the redirect_uri. Default value is True. - timeout_seconds (int): It will raise an error after the timeout timing - if there are no credentials response. The value is in seconds. + timeout_seconds (int): It will raise an error after the timeout timing + if there are no credentials response. The value is in seconds. + When set to None there is no timeout. Default value is None. kwargs: Additional keyword arguments passed through to :meth:`authorization_url`.