fix(gateway): go mod tidy and real go.sum; drop unused import in cache; proxmox-ve service touch-up
Made-with: Cursor
This commit is contained in:
@@ -41,6 +41,13 @@ export interface DeploymentResult {
|
||||
errors?: string[];
|
||||
}
|
||||
|
||||
function formatProxmoxAuthToken(username: string, tokenName: string, tokenValue: string): string {
|
||||
if (tokenName.includes('!')) {
|
||||
return `PVEAPIToken=${tokenName}=${tokenValue}`;
|
||||
}
|
||||
return `PVEAPIToken=${username}!${tokenName}=${tokenValue}`;
|
||||
}
|
||||
|
||||
export class ProxmoxVEIntegration {
|
||||
private config: ProxmoxConfig;
|
||||
private apiBaseUrl: string;
|
||||
@@ -60,7 +67,11 @@ export class ProxmoxVEIntegration {
|
||||
*/
|
||||
async authenticate(): Promise<void> {
|
||||
if (this.config.tokenName && this.config.tokenValue) {
|
||||
this.token = `PVEAPIToken=${this.config.username}!${this.config.tokenName}=${this.config.tokenValue}`;
|
||||
this.token = formatProxmoxAuthToken(
|
||||
this.config.username,
|
||||
this.config.tokenName,
|
||||
this.config.tokenValue
|
||||
);
|
||||
this.tokenExpiry = new Date(Date.now() + 24 * 60 * 60 * 1000);
|
||||
logger.info('Proxmox VE token authentication configured', {
|
||||
host: this.config.host,
|
||||
|
||||
Reference in New Issue
Block a user