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

Function renewingRefresher

internal/config/refreshable_test.go:847–858  ·  view source on GitHub ↗

renewingRefresher returns a mock refresher that always renews to a fresh, long lived credential.

()

Source from the content-addressed store, hash-verified

845
846// renewingRefresher returns a mock refresher that always renews to a fresh, long lived credential.
847func renewingRefresher() *ghmock.TokenRefresherMock {
848 future := time.Now().Add(time.Hour)
849 return &ghmock.TokenRefresherMock{
850 RefreshFunc: func(refreshToken string, hostname string) (gh.RefreshableCredential, error) {
851 return gh.RefreshableCredential{
852 AccessToken: "new-access",
853 RefreshToken: "new-refresh",
854 ExpiresAt: &future,
855 }, nil
856 },
857 }
858}
859
860func loginRefreshableWithExpiry(t *testing.T, authCfg *AuthConfig, hostname, username, access, refresh string, expiresAt time.Time, secure bool) {
861 t.Helper()

Callers 2

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected