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:
defiQUG
2026-04-21 22:00:37 -07:00
parent 468bc05b78
commit 97a1cb1b96
4 changed files with 147 additions and 3 deletions

View File

@@ -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,