getAuthTokenType returns a description of the authentication token type.
(token string)
| 556 | |
| 557 | // getAuthTokenType returns a description of the authentication token type. |
| 558 | func getAuthTokenType(token string) string { |
| 559 | if token == "" { |
| 560 | return "none" |
| 561 | } |
| 562 | |
| 563 | if strings.HasPrefix(token, "PVEAPIToken") { |
| 564 | return "API token" |
| 565 | } |
| 566 | |
| 567 | if strings.HasPrefix(token, "PVEAuthCookie=") { |
| 568 | return "auth cookie" |
| 569 | } |
| 570 | |
| 571 | return "unknown" |
| 572 | } |
no outgoing calls
no test coverage detected