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)
| 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. |
| 238 | func (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 |
nothing calls this directly
no test coverage detected