Loading ccserver/conf.py +11 −5 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class CCConf(object): ''' CONF_TEMPLATE = {'password': None, 'type': None, 'role': None, 'tags': {}, 'perms': None} Loading Loading @@ -188,6 +188,11 @@ class CCConf(object): conf = self._get_conf(login) passwd_conf = conf['password'] # Check if account logging is disabled: if passwd_conf is None: return None is_valid = False m = CCConf.RE_SALTPW.match(passwd_conf) if m is None: Loading Loading @@ -250,7 +255,7 @@ class CCConf(object): logging.debug('Removed tag %s for %s account' % (login, tag)) conf = self._get_conf(login) if tag in conf['tags']: conf['tags'][tag] del conf['tags'][tag] self._set_conf(login, conf) @_writer Loading @@ -270,7 +275,7 @@ class CCConf(object): raise CCConf.UnknownAccount('%s is not a file' % filename) @_writer def create_account(self, login, password, role): def create_account(self, login, role, password): ''' Create a new account. Loading @@ -286,9 +291,10 @@ class CCConf(object): raise CCConf.AlreadyExistingAccount('%s found' % filename) else: conf = CCConf.CONF_TEMPLATE.copy() conf['password'] = self._hash_password(password) conf['role'] = role conf['role'] = role if password is not None: conf['password'] = self._hash_password(password) self._set_conf(login, conf, create=True) def list_accounts(self): Loading ccserver/handlers.py +3 −3 Original line number Diff line number Diff line Loading @@ -120,11 +120,11 @@ class ClientHandler(OnlineCCHandler): @pure @listed def adduser(self, login, password, role): def addaccount(self, login, role, password=None): ''' Create a new account with specified login. ''' self._server.conf.create_account(login, password, role) self._server.conf.create_account(login, role, password) @pure @listed Loading Loading @@ -152,7 +152,7 @@ class ClientHandler(OnlineCCHandler): @pure @listed def deluser(self, login): def delaccount(self, login): ''' Delete the account with specified login. ''' Loading Loading
ccserver/conf.py +11 −5 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ class CCConf(object): ''' CONF_TEMPLATE = {'password': None, 'type': None, 'role': None, 'tags': {}, 'perms': None} Loading Loading @@ -188,6 +188,11 @@ class CCConf(object): conf = self._get_conf(login) passwd_conf = conf['password'] # Check if account logging is disabled: if passwd_conf is None: return None is_valid = False m = CCConf.RE_SALTPW.match(passwd_conf) if m is None: Loading Loading @@ -250,7 +255,7 @@ class CCConf(object): logging.debug('Removed tag %s for %s account' % (login, tag)) conf = self._get_conf(login) if tag in conf['tags']: conf['tags'][tag] del conf['tags'][tag] self._set_conf(login, conf) @_writer Loading @@ -270,7 +275,7 @@ class CCConf(object): raise CCConf.UnknownAccount('%s is not a file' % filename) @_writer def create_account(self, login, password, role): def create_account(self, login, role, password): ''' Create a new account. Loading @@ -286,9 +291,10 @@ class CCConf(object): raise CCConf.AlreadyExistingAccount('%s found' % filename) else: conf = CCConf.CONF_TEMPLATE.copy() conf['password'] = self._hash_password(password) conf['role'] = role conf['role'] = role if password is not None: conf['password'] = self._hash_password(password) self._set_conf(login, conf, create=True) def list_accounts(self): Loading
ccserver/handlers.py +3 −3 Original line number Diff line number Diff line Loading @@ -120,11 +120,11 @@ class ClientHandler(OnlineCCHandler): @pure @listed def adduser(self, login, password, role): def addaccount(self, login, role, password=None): ''' Create a new account with specified login. ''' self._server.conf.create_account(login, password, role) self._server.conf.create_account(login, role, password) @pure @listed Loading Loading @@ -152,7 +152,7 @@ class ClientHandler(OnlineCCHandler): @pure @listed def deluser(self, login): def delaccount(self, login): ''' Delete the account with specified login. ''' Loading