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

Method ActiveTokenType

internal/config/config.go:326–334  ·  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

324// caller that only needs to know that can avoid handling the token. It is
325// currently unused.
326func (c *AuthConfig) ActiveTokenType(hostname string) gh.TokenType {
327 token := c.ActiveToken(hostname).Token
328 for _, tokenType := range gh.TokenTypes {
329 if strings.HasPrefix(token, string(tokenType)) {
330 return tokenType
331 }
332 }
333 return gh.TokenTypeUnknown
334}
335
336// ActiveToken retrieves the active credential for the given hostname, searching environment variables, plain text
337// 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