renewingRefresher returns a mock refresher that always renews to a fresh, long lived credential.
()
| 845 | |
| 846 | // renewingRefresher returns a mock refresher that always renews to a fresh, long lived credential. |
| 847 | func 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 | |
| 860 | func loginRefreshableWithExpiry(t *testing.T, authCfg *AuthConfig, hostname, username, access, refresh string, expiresAt time.Time, secure bool) { |
| 861 | t.Helper() |
no test coverage detected