Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clock skew calculations #158

Merged
merged 3 commits into from
May 8, 2017
Merged

Fix clock skew calculations #158

merged 3 commits into from
May 8, 2017

Conversation

theacodes
Copy link
Contributor

@theacodes theacodes commented May 5, 2017

Previously, the clock skew adjusted in the wrong direction. It would cause us to consider credentials whose expiration time had already passed according to the system clock to still be sent to the server. This is the opposite of what we wanted to happen. This fixes it so that we report that credentials are expired slightly before the system clock thinks they've expired.

Previously, the clock skew adjusted in the wrong direction. It would cause us to consider credentials whose expiration time had already pass according to the system clock to still be sent to the server. This is the opposite of what we wanted to happen. This fixes it so that we report that credentials are expired slightly before the system clock thinks they've expired.
@@ -58,7 +58,7 @@ def expired(self):
"""
# Err on the side of reporting expiration early so that we avoid
# the 403-refresh-retry loop.
adjusted_now = _helpers.utcnow() - _helpers.CLOCK_SKEW
adjusted_now = _helpers.utcnow() + _helpers.CLOCK_SKEW

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theacodes theacodes merged commit 7af9f66 into master May 8, 2017
@theacodes theacodes deleted the jon-is-a-big-dumb-dumb branch May 8, 2017 16:40
tamakisquare added a commit to tamakisquare/Pyrebase that referenced this pull request Jun 1, 2017
This library was impacted by a bug in "google-auth" v1.0.0, which is fixed in v1.0.1
googleapis/google-auth-library-python#158

This commit is for adopting "google-auth" v1.0.1 and also removing the code
that was intended as a workaround to the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants