TokenRefresher exchanges a refresh token for a renewed credential against a host's OAuth token endpoint. It performs only the token endpoint request and response parsing; deciding when to refresh and serializing concurrent refreshes are the caller's responsibility, per the gh.TokenRefresher contract
| 22 | // only the token endpoint request and response parsing; deciding when to refresh and serializing concurrent refreshes |
| 23 | // are the caller's responsibility, per the gh.TokenRefresher contract. |
| 24 | type TokenRefresher struct { |
| 25 | httpClient *http.Client |
| 26 | clientID string |
| 27 | clientSecret string |
| 28 | } |
| 29 | |
| 30 | // NewTokenRefresher builds a TokenRefresher that renews credentials issued to gh's OAuth app. The provided HTTP client |
| 31 | // should be a plain client that sets no auth or other headers, since the token endpoint is reached without an existing |
nothing calls this directly
no outgoing calls
no test coverage detected