IsValid checks if the authentication token is still valid and not expired. Returns true if the token exists, has a non-empty ticket, and the current time is before the expiration time. This method is safe to call on nil tokens. Example usage: if token != nil && token.IsValid() { // Use existin
()
| 98 | // // Need to re-authenticate |
| 99 | // } |
| 100 | func (t *AuthToken) IsValid() bool { |
| 101 | return t != nil && t.Ticket != "" && time.Now().Before(t.ExpiresAt) |
| 102 | } |
| 103 | |
| 104 | // AuthManager handles Proxmox API authentication with support for both |
| 105 | // password-based and API token authentication methods. |
no outgoing calls