Acquire.Identity._useraccount module¶
-
class
UserAccount(username=None, user_uid=None, private_key=None, status=None)[source]¶ Bases:
objectThis 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
-
static
from_data(data, passphrase, mangleFunction=None)[source]¶ Return a UserAccount constructed from the passed data (dictionary)
-
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
-
static