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

Method ActiveTokenType

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

(hostname string)

Source from the content-addressed store, hash-verified

236// ActiveTokenType reports what kind of credential the active token is, so a
237// caller that only needs to know that can avoid handling the token.
238func (c *AuthConfig) ActiveTokenType(hostname string) gh.TokenType {
239 token, _ := c.ActiveToken(hostname)
240 for _, tokenType := range gh.TokenTypes {
241 if strings.HasPrefix(token, string(tokenType)) {
242 return tokenType
243 }
244 }
245 return gh.TokenTypeUnknown
246}
247
248// ActiveToken will retrieve the active auth token for the given hostname,
249// searching environment variables, plain text config, and

Callers

nothing calls this directly

Calls 1

ActiveTokenMethod · 0.95

Tested by

no test coverage detected