MCPcopy
hub / github.com/cli/cli / AuthTokenRefreshable

Function AuthTokenRefreshable

pkg/cmd/auth/shared/writeable.go:11–13  ·  view source on GitHub ↗

AuthTokenRefreshable reports whether the token is stored by gh and can be renewed with `gh auth refresh`.

(token, src string)

Source from the content-addressed store, hash-verified

9// AuthTokenRefreshable reports whether the token is stored by gh and can be
10// renewed with `gh auth refresh`.
11func AuthTokenRefreshable(token, src string) bool {
12 return token != "" && !strings.HasSuffix(src, "_TOKEN") && strings.HasPrefix(token, "gho_")
13}
14
15func AuthTokenWriteable(authCfg gh.AuthConfig, hostname string) (string, bool) {
16 token, src := authCfg.ActiveToken(hostname)

Callers 2

StringMethod · 0.92
authRecoveryCommandFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected