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)
| 300 | // caller that only needs to know that can avoid handling the token. It is |
| 301 | // currently unused. |
| 302 | func (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 |
nothing calls this directly
no test coverage detected