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

Ability to set Transport token #41

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

Conversation

mhemmings
Copy link

Add the ability to set the access token on a Transport. This is useful to create a Transport from a token already known (for example stored in a database) to avoid an unnecessary HTTP request to get a new one.

Also fix the build by changing to new jwt time types.

@mhemmings
Copy link
Author

@bradleyfalzon / @wlynch Let me know what you think :)

@mhemmings
Copy link
Author

I've just noticed the Token() method only returns a string, so there is currently no way to get the expires date out to "save" an access token. Not sure the best way to solve this in a backwards compatible way

@wlynch
Copy link
Collaborator

wlynch commented Nov 23, 2020

Thanks for the PR! I'm a little hesitant to expose the AccessToken type, since the github.InstallationOptions and github.Repository fields aren't meant to be set by the user.

The intent for this change seems very similar to oauth2.ReuseTokenSource (and oauth2.Token contains expiration information). I wonder if we should start exposing Token/TokenSource compatible types 🤔 - @bradleyfalzon what do you think?

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.

None yet

2 participants