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

Function renewingRefresher

internal/config/refreshable_test.go:1008–1019  ·  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

1006
1007// renewingRefresher returns a mock refresher that always renews to a fresh, long lived credential.
1008func renewingRefresher() *ghmock.TokenRefresherMock {
1009 future := time.Now().Add(time.Hour)
1010 return &ghmock.TokenRefresherMock{
1011 RefreshFunc: func(refreshToken string, hostname string) (gh.RefreshableCredential, error) {
1012 return gh.RefreshableCredential{
1013 AccessToken: "new-access",
1014 RefreshToken: "new-refresh",
1015 ExpiresAt: &future,
1016 }, nil
1017 },
1018 }
1019}
1020
1021func loginRefreshableWithExpiry(t *testing.T, authCfg *AuthConfig, hostname, username, access, refresh string, expiresAt time.Time, secure bool) {
1022 t.Helper()

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected