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 TokenExpiration to Response #2031

Merged
merged 11 commits into from
Aug 6, 2021
Merged

Conversation

w-haibara
Copy link
Contributor

GitHub has been updated to allow you to set the expiration date of your personal access token. And the expiration date is now displayed in the GitHub-Authentication-Token-Expiration header of the GItHub API.
https://github.blog/changelog/2021-07-26-expiration-options-for-personal-access-tokens/

This PR add TokenExpiration field to Response.

@google-cla google-cla bot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Aug 5, 2021
@gmlewis gmlewis changed the title Add TokenExpiration to Rsponce Add TokenExpiration to Response Aug 5, 2021
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, @w-haibara !

In addition to the comments below, please add a new unit test for the new parseTokenExpiration function.

Also please make sure to run gofmt on the edited files so that their formatting is standardized.

See CONTRIBUTING.md in the top-level of this repo for more information.

example/tokenauth/main.go Outdated Show resolved Hide resolved
github/github.go Outdated Show resolved Hide resolved
@gmlewis gmlewis requested a review from wesleimp August 5, 2021 17:13
@codecov
Copy link

codecov bot commented Aug 5, 2021

Codecov Report

Merging #2031 (d659626) into master (d8a66d0) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2031   +/-   ##
=======================================
  Coverage   97.86%   97.87%           
=======================================
  Files         107      107           
  Lines        6901     6907    +6     
=======================================
+ Hits         6754     6760    +6     
  Misses         81       81           
  Partials       66       66           
Impacted Files Coverage Δ
github/github.go 97.15% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8a66d0...d659626. Read the comment docs.

@w-haibara
Copy link
Contributor Author

Hi, @gmlewis ! Thanks for the thoughtful review.
I've fixed the areas you commented on and added a test. I apologize again for the unformatted commits. I've fixed that as well.

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, @w-haibara !

github/github_test.go Show resolved Hide resolved
github/github_test.go Outdated Show resolved Hide resolved
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, @w-haibara !
LGTM.

Awaiting second LGTM before merging.

@w-haibara
Copy link
Contributor Author

Thank you, @gmlewis.
This is almost the first OSS contributor for me. Your review has helped me a lot!

@gmlewis
Copy link
Collaborator

gmlewis commented Aug 6, 2021

Thank you, @gmlewis.
This is almost the first OSS contributor for me. Your review has helped me a lot!

Thank you, for your contributions, @w-haibara ! Your help is greatly appreciated!

Copy link

@Parker77 Parker77 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 gmlewis merged commit 54ec837 into google:master Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants