logger.info('Client not authenticated. IP: %s'%(self.address[0]))
# NOTE: We just ignore incoming messages as we treat the communication as one-way only, except for the auth msg.
self.close(1011,u'Please login, so you have a token, and please submit the token in the 1st message after the connection was made.')
exceptExceptionase:
exceptExceptionase:
logger.exception('Error when handling websocket message of User: %s from IP: %s'%(self.user,self.address[0]))
logger.exception('Error when handling websocket message of User: %s from IP: %s'%(self.user,self.address[0]))
raise
raise
...
@@ -139,33 +138,34 @@ class TMSSEventMessageHandlerForWebsocket(TMSSEventMessageHandler):
...
@@ -139,33 +138,34 @@ class TMSSEventMessageHandlerForWebsocket(TMSSEventMessageHandler):
auth_clients=[]
auth_clients=[]
logger.info('Checking which of these users should receive websocket update for obj=%s: %s'%(obj,[ws.userforwsinlist(self._ws_server.connections.values())]))
logger.info('Checking which of these users should receive websocket update for obj=%s: %s'%(obj,[ws.userforwsinlist(self._ws_server.connections.values())]))
logger.info('User=%s has permission=%s and will receive websocket update for obj=%s'%(user,"tmssapp.view_%s"%type(obj).__name__.lower(),obj))
auth_clients.append(ws)
else:
logger.info('User=%s has no permission=%s, checking for project-based permission to receive websocket update for obj=%s'%(user,"tmssapp.view_%s"%type(obj).__name__.lower(),obj))
logger.info("User=%s has project-based permission for project=%s and will receive websocket update for obj=%s"%(user,project_role['project'].lower(),obj))
break
else:
logger.info("%s websocket is not authenticated and will not receive websocket update for obj=%s"%(ws.user,obj))
logger.info("%s websocket is not authenticated and will not receive websocket update for obj=%s"%(ws.user,obj))
logger.info('User=%s has permission=%s and will receive websocket update for obj=%s'%(user,"tmssapp.view_%s"%type(obj).__name__.lower(),obj))
auth_clients.append(ws)
continue
logger.info('User=%s has no permission=%s, checking for project-based permission to receive websocket update for obj=%s'%(user,"tmssapp.view_%s"%type(obj).__name__.lower(),obj))
logger.info("User=%s has project-based permission for project=%s and will receive websocket update for obj=%s"%(user,project_role['project'].lower(),obj))