aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/google-auth/py3/google/oauth2/credentials.py
diff options
context:
space:
mode:
authorarmenqa <armenqa@yandex-team.com>2024-01-19 12:23:50 +0300
committerarmenqa <armenqa@yandex-team.com>2024-01-19 13:10:03 +0300
commit2de0149d0151c514b22bca0760b95b26c9b0b578 (patch)
tree2bfed9f3bce7e643ddf048bb61ce3dc0a714bcc2 /contrib/python/google-auth/py3/google/oauth2/credentials.py
parenta8c06d218f12b2406fbce24d194885c5d7b68503 (diff)
downloadydb-2de0149d0151c514b22bca0760b95b26c9b0b578.tar.gz
feat contrib: aiogram 3
Relates: https://st.yandex-team.ru/, https://st.yandex-team.ru/
Diffstat (limited to 'contrib/python/google-auth/py3/google/oauth2/credentials.py')
-rw-r--r--contrib/python/google-auth/py3/google/oauth2/credentials.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/contrib/python/google-auth/py3/google/oauth2/credentials.py b/contrib/python/google-auth/py3/google/oauth2/credentials.py
index a5c93ecc2f8..41f4a05bb6e 100644
--- a/contrib/python/google-auth/py3/google/oauth2/credentials.py
+++ b/contrib/python/google-auth/py3/google/oauth2/credentials.py
@@ -160,7 +160,11 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
# unpickling certain callables (lambda, functools.partial instances)
# because they need to be importable.
# Instead, the refresh_handler setter should be used to repopulate this.
- del state_dict["_refresh_handler"]
+ if "_refresh_handler" in state_dict:
+ del state_dict["_refresh_handler"]
+
+ if "_refresh_worker" in state_dict:
+ del state_dict["_refresh_worker"]
return state_dict
def __setstate__(self, d):
@@ -183,6 +187,8 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
self._universe_domain = d.get("_universe_domain") or _DEFAULT_UNIVERSE_DOMAIN
# The refresh_handler setter should be used to repopulate this.
self._refresh_handler = None
+ self._refresh_worker = None
+ self._use_non_blocking_refresh = d.get("_use_non_blocking_refresh", False)
@property
def refresh_token(self):
@@ -302,15 +308,8 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr
universe_domain=self._universe_domain,
)
+ @_helpers.copy_docstring(credentials.CredentialsWithUniverseDomain)
def with_universe_domain(self, universe_domain):
- """Create a copy of the credential with the given universe domain.
-
- Args:
- universe_domain (str): The universe domain value.
-
- Returns:
- google.oauth2.credentials.Credentials: A new credentials instance.
- """
return self.__class__(
self.token,