Fix console WebSocket authentication for nodes on remote computes (#3078)

* Use the compute credentials for console and VNC WebSocket forwarding

The controller forwarded the console and VNC WebSocket to a compute with
its own local server credentials instead of the credentials stored on the
compute. Any remote compute with its own credentials rejected the
connection with a 401 error, so the web console could not open for nodes
running on a remote compute.

Fixes #3076

* Do not start the console when compute WebSocket authentication fails

The VPCS and VirtualBox console WebSocket routes still called
start_websocket_console() with None after the authentication dependency
rejected the client and closed the socket. The handler crashed with
"AttributeError: 'NoneType' object has no attribute 'client'".

Add the same guard the other node types already have. See #3076
This commit is contained in:
Guobin Yue authored and GitHub committed 2026-11-14 18:58:44 +01:00
1 parent 3aaf125b88
commit fe51feec66
6 files changed
+121 -26

No files matched your search

+10
View File
@@ -23,6 +23,7 @@ import logging
import socket
import sys
from asyncio import timeout as asynctimeout
from typing import Optional
import aiohttp
from fastapi import HTTPException
@@ -295,6 +296,15 @@ class Compute:
def password(self, value):
self._set_auth(self._user, value)
@property
def auth_header(self) -> Optional[str]:
"""
Value for the Authorization header when sending requests to this compute,
or None when the compute has no user configured.
"""
return self._auth
@property
def cpu_usage_percent(self):
return self._cpu_usage_percent