diff --git a/server/src/uds/core/managers/user_service.py b/server/src/uds/core/managers/user_service.py index 7318cdc8..cdf56206 100644 --- a/server/src/uds/core/managers/user_service.py +++ b/server/src/uds/core/managers/user_service.py @@ -567,7 +567,8 @@ class UserServiceManager: if not idTransport: # Find a suitable transport t: Transport for t in userService.deployed_service.transports.order_by('priority'): - if t.validForIp(srcIp): + typeTrans = t.getType() + if t.validForIp(srcIp) and typeTrans.supportsOs(os['OS']) and t.validForOs(os['OS']): idTransport = t.uuid break diff --git a/server/src/uds/models/transport.py b/server/src/uds/models/transport.py index ae3c55ff..ad57e119 100644 --- a/server/src/uds/models/transport.py +++ b/server/src/uds/models/transport.py @@ -80,7 +80,10 @@ class Transport(ManagedObjectModel, TaggingMixin): :note: We only need to get info from this, not access specific data (class specific info) """ - return transports.factory().lookup(self.data_type) + v = transports.factory().lookup(self.data_type) + if not v: + raise Exception('transport not found') + return v def validForIp(self, ipStr: str) -> bool: """ diff --git a/server/src/uds/web/views/auth.py b/server/src/uds/web/views/auth.py index 221abf70..0bfc5a73 100644 --- a/server/src/uds/web/views/auth.py +++ b/server/src/uds/web/views/auth.py @@ -196,9 +196,10 @@ def ticketAuth(request: 'HttpRequest', ticketId: str) -> HttpResponse: # pylint request.user = usr # Temporarily store this user as "authenticated" user, next requests will be done using session request.session['ticket'] = '1' # Store that user access is done using ticket + # Override and recalc transport based on current os + transport = None + logger.debug("Service & transport: %s, %s", servicePool, transport) - for v in ServicePool.objects.all(): - logger.debug("%s %s", v.uuid, v.name) # Check if servicePool is part of the ticket if servicePool: