1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(console): the console daemons hold to what the console page allowed

The token now names the console type it was made for: novncd accepts only
a VNC page's token and socketiod only a serial page's, so a VNC page's
token no longer opens the serial console without the VNC password.

A VNC session re-checks every 10 s, as the serial one did, that its user
may still open the console; a deactivated user or a removed owner loses
it. The check (may_still_open) moves to console.tokens for both daemons.
This commit is contained in:
catborise 2026-11-05 15:49:31 +03:00
parent f670ee7333
commit 458074df82
10 changed files with 110 additions and 74 deletions

View file

@ -90,7 +90,7 @@ def console(request, compute_id, uuid):
return render(request, "console-error.html", {"instance": instance, "console_error": console_error})
# the console daemons' credential for this page
token = tokens.SIGNER.sign(f"{compute_id}:{uuid}:{request.user.id}")
token = tokens.sign(compute_id, uuid, request.user.id, console_type)
if console_type == "pty":
return render(request, "console-xterm.html", {"instance": instance, "token": token})