GitHub.jl icon indicating copy to clipboard operation
GitHub.jl copied to clipboard

RefreshAuth type

Open schlichtanders opened this issue 1 year ago • 0 comments
trafficstars

Hi there, I was using a RefreshAuth type for github which I build myself by patching GitHub.jl. It does the following:

  • behaves like a normal auth until an error is thrown
  • if this error is an authentication error, it tries to refresh the authentication token with the additionally given refresh token and tries again
  • if it still errors, the error is thrown as usual

This is very handy when dealing with short lived tokens.

Since Julia 1.10 it is unfortunately no longer possible to patch other packages that easily, and hence there is currently no way to implement this on top of GitHub, as one need changes to github_request.

It would be great if some logic like this could become part of GitHub.jl

schlichtanders avatar Apr 22 '24 12:04 schlichtanders