user.py

tcprocd user.

tcprocd.user.make_password(password)[source]

Hash the given password and return it.

class tcprocd.user.User(username, password=None, admin=False, user=None, group=None)[source]

Bases: object

An object to store credentials and permissions.

Parameters:
  • usernamestr - Username of this user.
  • passwordstr - Password hash of this user.
  • adminbool - Whether this user is an admin. (Default: False)
as_dict()[source]

Return a compact dict to re-create the user object.

set_password(raw_password)[source]

Hash the given password and store it.

Parameters:raw_passwordstr - The password to hash and store
check_password(raw_password)[source]

Hash the given password and compare it to the users password.

Parameters:raw_passwordstr - The password to compare.
Returns:bool - Whether the password matches.