From 02aec9ebea1efba14ecd9917003318c678c8078b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Wed, 13 Jul 2022 13:14:20 +0200 Subject: [PATCH] Moved required client versio ton core __init__,py --- server/src/uds/REST/methods/client.py | 4 ++-- server/src/uds/core/__init__.py | 2 ++ server/src/uds/dispatchers/guacamole/views.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/src/uds/REST/methods/client.py b/server/src/uds/REST/methods/client.py index 43c1275a8..31cfb148a 100644 --- a/server/src/uds/REST/methods/client.py +++ b/server/src/uds/REST/methods/client.py @@ -44,13 +44,13 @@ from uds.web.util import errors from uds.core.managers import cryptoManager, userServiceManager from uds.core.util.config import GlobalConfig from uds.core.services.exceptions import ServiceNotReadyError -from uds.core import VERSION as UDS_VERSION +from uds.core import VERSION as UDS_VERSION, REQUIRED_CLIENT_VERSION logger = logging.getLogger(__name__) CLIENT_VERSION = UDS_VERSION -REQUIRED_CLIENT_VERSION = '3.5.0' + # Enclosed methods under /client path diff --git a/server/src/uds/core/__init__.py b/server/src/uds/core/__init__.py index 894d8cade..26d20ca6d 100644 --- a/server/src/uds/core/__init__.py +++ b/server/src/uds/core/__init__.py @@ -42,3 +42,5 @@ from .module import Module VERSION = '4.x.x-DEVEL' VERSION_STAMP = '{}-DEVEL'.format(time.strftime("%Y%m%d")) +# Minimal uds client version required to connect to this server +REQUIRED_CLIENT_VERSION = '3.5.0' \ No newline at end of file diff --git a/server/src/uds/dispatchers/guacamole/views.py b/server/src/uds/dispatchers/guacamole/views.py index 852048586..90af27502 100644 --- a/server/src/uds/dispatchers/guacamole/views.py +++ b/server/src/uds/dispatchers/guacamole/views.py @@ -78,8 +78,9 @@ def guacamole( try: userService = UserService.objects.get(uuid=ti['userService']) - if not userService.isUsable(): - raise Exception() # Not usable, so we will not use it :) + if not userService.isUsable() or not userService.user: + # Not usable, or not assigned to a user, we will not use it + raise Exception() # Log message and event protocol = 'RDS' if 'remote-app' in val else val['protocol'].upper() host = val.get('hostname', '0.0.0.0')