forked from shaba/openuds
* added os type verify to ticketing auth
* fixed getType method
This commit is contained in:
parent
099a9ba3c1
commit
3e67852d8a
@ -567,7 +567,8 @@ class UserServiceManager:
|
|||||||
if not idTransport: # Find a suitable transport
|
if not idTransport: # Find a suitable transport
|
||||||
t: Transport
|
t: Transport
|
||||||
for t in userService.deployed_service.transports.order_by('priority'):
|
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
|
idTransport = t.uuid
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -80,7 +80,10 @@ class Transport(ManagedObjectModel, TaggingMixin):
|
|||||||
|
|
||||||
:note: We only need to get info from this, not access specific data (class specific info)
|
: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:
|
def validForIp(self, ipStr: str) -> bool:
|
||||||
"""
|
"""
|
||||||
|
@ -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.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
|
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)
|
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
|
# Check if servicePool is part of the ticket
|
||||||
if servicePool:
|
if servicePool:
|
||||||
|
Loading…
Reference in New Issue
Block a user