def authenticate(username, password): logging.info("Authenticate user {}".format(username)) if User().authenticate(username, password)[0] == True: logging.info("User {} successfully authenticated".format(username)) return converters.json2obj('{"id": 1, "username": "******", "password": "******"}') else: logging.warning("Authentication failed for user {}".format(username)) return False
def delete(username): """Delete a user account""" click.echo("Delete user account") User().delete(username)
def update(username, password): """Change user password""" click.echo("Change user password") User().update(username, password)
def add(username, password): """Create a new user account""" User().add(username, password)
def list(): """Show all configured user accounts""" click.echo("User Accounts:") User().show()
def authenticate(username, password): if User().authenticate(username, password)[0] == True: return converters.json2obj('{"id": 1, "username": "******", "password": "******"}') else: return False