def connectionMade(self): # Provision security if not self.factory.config.authentication: # Will not require an authentication from client self.authentication = { 'username': '******', 'password': None, 'printedPassword': None, 'auth': True } # Call CmdProtocol.connectionMade() depending on the security policy if self.authentication['auth']: CmdProtocol.connectionMade(self) elif self.authentication['username'] is None: self.oldPrompt = self.prompt self.prompt = 'Username: '******'Authentication required.\n\n') # Provision managers self.managers = { 'user': UsersManager(self, self.factory.pb), 'group': GroupsManager(self, self.factory.pb), 'mointerceptor': MoInterceptorManager(self, self.factory.pb), 'mtinterceptor': MtInterceptorManager(self, self.factory.pb), 'morouter': MoRouterManager(self, self.factory.pb), 'mtrouter': MtRouterManager(self, self.factory.pb), 'smppccm': SmppCCManager(self, self.factory.pb), 'filter': FiltersManager(self), 'httpccm': HttpccManager(self), 'stats': StatsManager(self, self.factory.pb) }
def __init__(self, log_category='jcli'): CmdProtocol.__init__(self, log_category) # Init authentication self.authentication = { 'username': None, 'password': None, 'printedPassword': None, 'auth': False } # Provision commands if 'persist' not in self.commands: self.commands.append('persist') if 'load' not in self.commands: self.commands.append('load') if 'user' not in self.commands: self.commands.append('user') if 'group' not in self.commands: self.commands.append('group') if 'filter' not in self.commands: self.commands.append('filter') if 'morouter' not in self.commands: self.commands.append('morouter') if 'mtrouter' not in self.commands: self.commands.append('mtrouter') if 'smppccm' not in self.commands: self.commands.append('smppccm') if 'httpccm' not in self.commands: self.commands.append('httpccm') if 'stats' not in self.commands: self.commands.append('stats')
def connectionMade(self): # Provision security if not self.factory.config.authentication: # Will not require an authentication from client self.authentication = {"username": "******", "password": None, "printedPassword": None, "auth": True} # Call CmdProtocol.connectionMade() depending on the security policy if self.authentication["auth"]: CmdProtocol.connectionMade(self) elif self.authentication["username"] is None: self.oldPrompt = self.prompt self.prompt = "Username: "******"Authentication required.\n\n") # Provision managers self.managers = { "user": UsersManager(self, self.factory.pb), "group": GroupsManager(self, self.factory.pb), "morouter": MoRouterManager(self, self.factory.pb), "mtrouter": MtRouterManager(self, self.factory.pb), "smppccm": SmppCCManager(self, self.factory.pb), "filter": FiltersManager(self), "httpccm": HttpccManager(self), }
def __init__(self, log_category="jcli"): CmdProtocol.__init__(self, log_category) # Init authentication self.authentication = {"username": None, "password": None, "printedPassword": None, "auth": False} # Provision commands if "persist" not in self.commands: self.commands.append("persist") if "load" not in self.commands: self.commands.append("load") if "user" not in self.commands: self.commands.append("user") if "group" not in self.commands: self.commands.append("group") if "filter" not in self.commands: self.commands.append("filter") if "morouter" not in self.commands: self.commands.append("morouter") if "mtrouter" not in self.commands: self.commands.append("mtrouter") if "smppccm" not in self.commands: self.commands.append("smppccm") if "httpccm" not in self.commands: self.commands.append("httpccm")
def connectionMade(self): # Provision security if not self.factory.config.authentication: # Will not require an authentication from client self.authentication = {'username': '******', 'password': None, 'printedPassword': None, 'auth': True} # Call CmdProtocol.connectionMade() depending on the security policy if self.authentication['auth']: CmdProtocol.connectionMade(self) elif self.authentication['username'] is None: self.oldPrompt = self.prompt self.prompt = 'Username: '******'Authentication required.\n\n') # Provision managers self.managers = {'user': UsersManager(self, self.factory.pb), 'group': GroupsManager(self, self.factory.pb), 'mointerceptor': MoInterceptorManager(self, self.factory.pb), 'mtinterceptor': MtInterceptorManager(self, self.factory.pb), 'morouter': MoRouterManager(self, self.factory.pb), 'mtrouter': MtRouterManager(self, self.factory.pb), 'smppccm': SmppCCManager(self, self.factory.pb), 'filter': FiltersManager(self), 'httpccm': HttpccManager(self), 'stats': StatsManager(self, self.factory.pb)}
def __init__(self, log_category='jcli'): CmdProtocol.__init__(self, log_category) # Init authentication self.authentication = {'username': None, 'password': None, 'printedPassword': None, 'auth': False} # Provision commands if 'persist' not in self.commands: self.commands.append('persist') if 'load' not in self.commands: self.commands.append('load') if 'user' not in self.commands: self.commands.append('user') if 'group' not in self.commands: self.commands.append('group') if 'filter' not in self.commands: self.commands.append('filter') if 'mointerceptor' not in self.commands: self.commands.append('mointerceptor') if 'mtinterceptor' not in self.commands: self.commands.append('mtinterceptor') if 'morouter' not in self.commands: self.commands.append('morouter') if 'mtrouter' not in self.commands: self.commands.append('mtrouter') if 'smppccm' not in self.commands: self.commands.append('smppccm') if 'httpccm' not in self.commands: self.commands.append('httpccm') if 'stats' not in self.commands: self.commands.append('stats')
def lineReceived(self, line): """Go to CmdProtocol.lineReceived when authenticated only""" if self.authentication['auth']: return CmdProtocol.lineReceived(self, line) elif self.authentication['username'] is None: return self.auth_username(line) elif self.authentication['password'] is None: return self.auth_password(line)
def lineReceived(self, line): "Go to CmdProtocol.lineReceived when authenticated only" if self.authentication["auth"]: return CmdProtocol.lineReceived(self, line) elif self.authentication["username"] is None: return self.AUTH_username(line) elif self.authentication["password"] is None: return self.AUTH_password(line)
def handle_TAB(self): """TABulation is only enabled when authenticated""" if self.authentication['auth']: return CmdProtocol.handle_TAB(self)
def handle_TAB(self): "TABulation is only enabled when authenticated" if self.authentication["auth"]: return CmdProtocol.handle_TAB(self)