MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / NewAuthManagerWithToken

Function NewAuthManagerWithToken

pkg/api/auth.go:175–181  ·  view source on GitHub ↗

NewAuthManagerWithToken creates a new authentication manager for API token authentication. This method sets up the manager to use Proxmox API tokens for stateless authentication. API tokens don't require session management and are recommended for automated systems and service accounts. Parameters:

(httpClient *HTTPClient, token string, logger interfaces.Logger)

Source from the content-addressed store, hash-verified

173// log.Fatal("Authentication failed:", err)
174// }
175func NewAuthManagerWithToken(httpClient *HTTPClient, token string, logger interfaces.Logger) *AuthManager {
176 return &AuthManager{
177 httpClient: httpClient,
178 token: token,
179 logger: logger,
180 }
181}
182
183// EnsureAuthenticated ensures the client is properly authenticated and ready for API calls.
184//

Calls

no outgoing calls