ghinstallation
ghinstallation copied to clipboard
Ability to set Transport token
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.
@bradleyfalzon / @wlynch Let me know what you think :)
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
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?