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 parsing token expiration time and small cleanup #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

erickt
Copy link

@erickt erickt commented Jul 12, 2018

This fixes a bug where oauth2device wasn't properly passing along the token expiration to the oauth2 library. That library expects there to be a field named Expiry, which is the concrete time it expires, rather than a relative time. This resulted in the oauth2 not renewing the tokens when they actually expired.

It also makes sure to close the bodies, and breaks a dependency cycle running the tests.

erickt added 3 commits July 10, 2018 09:44
The golang oauth2 library's `Token` doesn't have an "expires_in"
field. Instead oauth2 internally parses the expiration into a future
unix timestamp. So before this patch, the tokens that oauth2device
was producing didn't properly capture the expiration time. This patch
fixes it by copying the logic from oauth2, which is unfortunately
not exposed in a way that we can directly use.

Change-Id: Idec2632c5d4cb272d9d2e8e0099972ad9dda9c3d
Change-Id: Idab0ebad1f5f10b0a40a9a6f3663d74a5a9f8e1c
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.

1 participant