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

Add Transport.Expiry() to query token expiration #85

Merged
merged 3 commits into from
Jan 24, 2023

Conversation

wwade
Copy link
Contributor

@wwade wwade commented Jan 19, 2023

Since it could be interesting in some cases, return this for the user to examine.

Also factor out the "is a token expired" logic and return the current value of "we think it's expired" when calling Expiry().

expiresAt, expired, err := trans.Expiry()

Since it could be interesting in some cases, return this for the user
to examine.

Also factor out the "is a token expired" logic and return the current
value of "we think it's expired" when calling Expiry().

    expiresAt, expired, err := trans.Expiry()
@bradleyfalzon
Copy link
Owner

@wwade thanks, and thanks for maintaining some consistency there too.

@wlynch thoughts, this looks good to me, makes sense for debug code to see what behaviour we're expecting. Existing tests should cover the additional code, would be nice to see a test on the new public method though?

@wwade
Copy link
Contributor Author

wwade commented Jan 19, 2023

@wlynch thoughts, this looks good to me, makes sense for debug code to see what behaviour we're expecting. Existing tests should cover the additional code, would be nice to see a test on the new public method though?

I threw in a quick test case to cover the branches 😄

transport.go Outdated Show resolved Hide resolved
@wlynch
Copy link
Collaborator

wlynch commented Jan 24, 2023

No other comments, so submitting.

Thanks! 🎉

@wlynch wlynch merged commit 683a7b8 into bradleyfalzon:master Jan 24, 2023
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.

4 participants