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