MCPcopy Create free account
hub / github.com/cli/cli / TokenRefresher

Struct TokenRefresher

internal/authflow/refresh.go:24–28  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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.
24type 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected