示例#1
0
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
示例#2
0
def delete(username):
    """Delete a user account"""
    click.echo("Delete user account")
    User().delete(username)
示例#3
0
def update(username, password):
    """Change user password"""
    click.echo("Change user password")
    User().update(username, password)
示例#4
0
def add(username, password):
    """Create a new user account"""
    User().add(username, password)
示例#5
0
def list():
    """Show all configured user accounts"""
    click.echo("User Accounts:")
    User().show()
示例#6
0
def authenticate(username, password):
    if User().authenticate(username, password)[0] == True:
        return converters.json2obj('{"id": 1, "username": "******", "password": "******"}')
    else:
        return False