MCPcopy Create free account
hub / github.com/cli/cli / ActiveTokenType

Method ActiveTokenType

internal/config/config.go:302–310  ·  view source on GitHub ↗

ActiveTokenType reports what kind of credential the active token is, so a caller that only needs to know that can avoid handling the token. It is currently unused.

(hostname string)

Source from the content-addressed store, hash-verified

300// caller that only needs to know that can avoid handling the token. It is
301// currently unused.
302func (c *AuthConfig) ActiveTokenType(hostname string) gh.TokenType {
303 token := c.ActiveToken(hostname).Token
304 for _, tokenType := range gh.TokenTypes {
305 if strings.HasPrefix(token, string(tokenType)) {
306 return tokenType
307 }
308 }
309 return gh.TokenTypeUnknown
310}
311
312// ActiveToken retrieves the active credential for the given hostname, searching environment variables, plain text
313// config, and lastly encrypted storage. It returns the last stored token as-is, including the current access token of

Callers

nothing calls this directly

Calls 1

ActiveTokenMethod · 0.95

Tested by

no test coverage detected