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 parse token expiration #2650

Merged

Conversation

christoph-jerolimov
Copy link
Contributor

Solves #2649 issue without breaking API changes.

  1. Fixed date parsing and allow 24-hour format 😄
  2. Add support for tokens that include the timezone offset instead of the timezone, we found both in our logs 🤷‍♂️

If you prefer I could also make it optional (TokenExpiration *Timestamp) so that it's not required to check for "is timestamp equals 0001-01-01)

Or by adding a new type TokenExpiration time.Time with a func IsValid for a token that has no expiration header?!

But both would change the public API and for my first PR here I focused on fixing just the bug without an API change.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @jerolimov !
Just a few minor tweaks, please, then we should be ready for a second LGTM+Approval before merging.

github/github.go Outdated Show resolved Hide resolved
github/github.go Outdated Show resolved Hide resolved
github/github_test.go Outdated Show resolved Hide resolved
github/github_test.go Outdated Show resolved Hide resolved
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jan 30, 2023
@gmlewis gmlewis changed the title Fix #2649: Fix parse token expiration Fix parse token expiration Jan 30, 2023
@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Merging #2650 (9bac7a5) into master (da244a4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2650   +/-   ##
=======================================
  Coverage   98.07%   98.08%           
=======================================
  Files         130      130           
  Lines       11302    11304    +2     
=======================================
+ Hits        11085    11087    +2     
  Misses        148      148           
  Partials       69       69           
Impacted Files Coverage Δ
github/github.go 97.93% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chmouel
Copy link
Contributor

chmouel commented Jan 31, 2023

nice one, thanks

@christoph-jerolimov
Copy link
Contributor Author

@gmlewis thanks for the feedback, updated the PR. I took everything. 👍

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @jerolimov !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

Copy link
Contributor

@valbeat valbeat left a comment

Choose a reason for hiding this comment

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

LGTM!

@gmlewis
Copy link
Collaborator

gmlewis commented Feb 1, 2023

Thank you, @valbeat !
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Feb 1, 2023
@gmlewis gmlewis merged commit 8eac70f into google:master Feb 1, 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