AuthTokenRefreshable reports whether the token is stored by gh and can be renewed with `gh auth refresh`. TODO: this matches a token prefix itself. It could ask gh.AuthConfig.ActiveTokenType instead.
(token, src string)
| 12 | // TODO: this matches a token prefix itself. It could ask |
| 13 | // gh.AuthConfig.ActiveTokenType instead. |
| 14 | func AuthTokenRefreshable(token, src string) bool { |
| 15 | return token != "" && !strings.HasSuffix(src, "_TOKEN") && strings.HasPrefix(token, "gho_") |
| 16 | } |
| 17 | |
| 18 | func AuthTokenWriteable(authCfg gh.AuthConfig, hostname string) (string, bool) { |
| 19 | token, src := authCfg.ActiveToken(hostname) |
no outgoing calls
no test coverage detected