Fixing tickets for v3 actors && changing path for "join" registry key for join domain on 2 steps

This commit is contained in:
Adolfo Gómez García 2020-01-28 13:05:50 +01:00
parent 9fd3ac280b
commit 820ba906f0
2 changed files with 11 additions and 4 deletions

View File

@ -84,7 +84,7 @@ def writeConfig(config: types.ActorConfigurationType) -> None:
def useOldJoinSystem() -> bool: def useOldJoinSystem() -> bool:
try: try:
key = wreg.OpenKey(BASEKEY, 'Software\\UDSEnterpriseActor', 0, wreg.KEY_QUERY_VALUE) key = wreg.OpenKey(BASEKEY, PATH, 0, wreg.KEY_QUERY_VALUE)
try: try:
data, _ = wreg.QueryValueEx(key, 'join') data, _ = wreg.QueryValueEx(key, 'join')
except Exception: except Exception:

View File

@ -379,10 +379,16 @@ class Ticket(ActorV3Action):
logger.debug('Args: %s, Params: %s', self._args, self._params) logger.debug('Args: %s, Params: %s', self._args, self._params)
try: try:
return ActorV3Action.actorResult(TicketStore.get(self._params['ticket'], invalidate=True)) # Simple check that token exists
except TicketStore.DoesNotExist: ActorToken.objects.get(token=self._params['token']) # Not assigned, because only needs check
except ActorToken.DoesNotExist:
raise BlockAccess() # If too many blocks... raise BlockAccess() # If too many blocks...
try:
return ActorV3Action.actorResult(TicketStore.get(self._params['ticket'], invalidate=True))
except TicketStore.DoesNotExists:
return ActorV3Action.actorResult(error='Invalid ticket')
class Notify(ActorV3Action): class Notify(ActorV3Action):
name = 'notify' name = 'notify'
@ -400,7 +406,8 @@ class Notify(ActorV3Action):
# Check block manually # Check block manually
checkBlockedIp(self._request.ip) # pylint: disable=protected-access checkBlockedIp(self._request.ip) # pylint: disable=protected-access
userService = UserService.objects.get(uuid=self._params['token']) userService = UserService.objects.get(uuid=self._params['token'])
# TODO: finish this # TODO: finish this when needed :)
return ActorV3Action.actorResult('ok') return ActorV3Action.actorResult('ok')
except UserService.DoesNotExist: except UserService.DoesNotExist:
# For blocking attacks # For blocking attacks