Acquire.Identity._useraccount module

class UserAccount(username=None, user_uid=None, private_key=None, status=None)[source]

Bases: object

This class holds all information about a user’s account, e.g. their username, the sanitised username for the person on the system, their account keys, status etc.

This data can be serialised to an from json to allow easy saving a retrieval from an object store

static create(username, password, _service_uid=None, _service_public_key=None)[source]

Create a new account with username ‘username’, which will be secured using the passed password.

Note that this will create an account with a specified user UID, meaning that different users can have the same username. We identify the right user via the combination of username, password and OTP code.

Normally the UID of the service, and the skeleton key used to encrypt the backup password are obtained directly from the service. However, when initialising a new service we must pass these directly. In those cases, pass the object using _service_uid and _service_public_key

This returns a tuple of the user_uid and OTP for the newly-created account

encoded_name()[source]

Return the encoded (sanitised) username

static from_data(data, passphrase, mangleFunction=None)[source]

Return a UserAccount constructed from the passed data (dictionary)

is_active()[source]

Return whether or not this is an active account

is_valid()[source]

Return whether or not this is a valid account

static login(credentials, user_uid=None, remember_device=False)[source]

Login to the session with specified ‘short_uid’ with the user with passed ‘username’ and ‘credentials’, optionally specifying the user_uid

login_root_url()[source]

Return the root URL used to log into this account

name()[source]

Return the name of this account

private_key()[source]

Return the lines of the private key for this account

public_key()[source]

Return the lines of the public key for this account

status()[source]

Return the status for this account

to_data(passphrase, mangleFunction=None)[source]

Return a data representation of this object (dictionary)

uid()[source]

Return the globally unique ID for this account

username()[source]

Synonym for ‘name’