From 5b55114bbeb0a45d09937ced6ff02ced30525e25 Mon Sep 17 00:00:00 2001 From: melanie witt Date: Tue, 2 Apr 2019 01:06:29 +0000 Subject: [PATCH] Restore token forwarding in vnc_lite This is a partial revert of commit 51f9f0098d306bbc67cc8e02ae547921b6f6585c which intended to remove unnecessary options. In OpenStack Nova, we use the vnc_lite (formerly vnc_auto) functionality as a default in our novnc proxy [1] and the proxy relies on token validation. We need to be able to access the token in the URL in our websockify proxy server. Websockify itself also offers a token plugin feature that requires forwarding of the token [2]. Restoring token forwarding allows users to continue using token plugins with vnc_lite. [1] https://docs.openstack.org/nova/latest/admin/remote-console-access.html#novnc-based-vnc-console [2] https://github.com/novnc/websockify/wiki/Token-based-target-selection --- vnc_lite.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vnc_lite.html b/vnc_lite.html index 1012a475..71ab1a29 100644 --- a/vnc_lite.html +++ b/vnc_lite.html @@ -154,6 +154,14 @@ const password = readQueryVariable('password', ''); const path = readQueryVariable('path', 'websockify'); + // If a token variable is passed in, forward it in the URL so that it + // is accessible by a websockify token plugin + var token = WebUtil.getConfigVar('token', null); + if (token) { + // if token is already present in the path we should use it + path = WebUtil.injectParamIfMissing(path, "token", token); + } + // | | | | | | // | | | Connect | | | // v v v v v v