diff options
author | arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> | 2021-09-09 17:09:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-09 17:09:54 -0700 |
commit | 738611bd2914f0fd5fa8b49b65f56ef321829c85 (patch) | |
tree | 5a9d1e0c2138c038066dd66d9bf639da4b4123f6 /google/oauth2/credentials.py | |
parent | 13aed5ffe3ba435004ab48202462452f04d7cb29 (diff) | |
download | google-auth-library-python-738611bd2914f0fd5fa8b49b65f56ef321829c85.tar.gz |
fix: rename CLOCK_SKEW and separate client/server user case (#863)
* fix: rename CLOCK_SKEW and separate client/server user case
* update clock skew to 20s
Diffstat (limited to 'google/oauth2/credentials.py')
-rw-r--r-- | google/oauth2/credentials.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/google/oauth2/credentials.py b/google/oauth2/credentials.py index e259f78..6d34edf 100644 --- a/google/oauth2/credentials.py +++ b/google/oauth2/credentials.py @@ -270,7 +270,7 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr raise exceptions.RefreshError( "The refresh_handler returned expiry is not a datetime object." ) - if _helpers.utcnow() >= expiry - _helpers.CLOCK_SKEW: + if _helpers.utcnow() >= expiry - _helpers.REFRESH_THRESHOLD: raise exceptions.RefreshError( "The credentials returned by the refresh_handler are " "already expired." @@ -359,7 +359,7 @@ class Credentials(credentials.ReadOnlyScoped, credentials.CredentialsWithQuotaPr expiry.rstrip("Z").split(".")[0], "%Y-%m-%dT%H:%M:%S" ) else: - expiry = _helpers.utcnow() - _helpers.CLOCK_SKEW + expiry = _helpers.utcnow() - _helpers.REFRESH_THRESHOLD # process scopes, which needs to be a seq if scopes is None and "scopes" in info: |