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

Method ActiveTokenType

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

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

Callers

nothing calls this directly

Calls 1

ActiveTokenMethod · 0.95

Tested by

no test coverage detected