setupLegacyUnkeyedKeyringState recreates the state a very old gh install leaves behind: an active user is recorded for github.com, but the only keyring token lives in the legacy unkeyed slot rather than a per-user slot. It logs in to record the active user, deletes the per-user keyring slot that log
(t *testing.T, c gh.Config)
| 496 | // to record the active user, deletes the per-user keyring slot that login writes, and sets the unkeyed slot. The |
| 497 | // keyring service name mirrors config.keyringServiceName, which is unexported. |
| 498 | func setupLegacyUnkeyedKeyringState(t *testing.T, c gh.Config) { |
| 499 | t.Helper() |
| 500 | login(t, c, "github.com", "test-user", "gho_PERUSER", "https", true) |
| 501 | require.NoError(t, keyring.Delete("gh:github.com", "test-user")) |
| 502 | require.NoError(t, keyring.Set("gh:github.com", "", "gho_LEGACY")) |
| 503 | } |
| 504 | |
| 505 | func loginRefreshable(t *testing.T, c gh.Config, hostname, username, accessToken, refreshToken string, secureStorage bool) { |
| 506 | t.Helper() |
no test coverage detected