Acquire.Client._user module

class User(username=None, user_uid=None, identity_url=None, identity_uid=None)[source]

Bases: object

This class holds all functionality that would be used by a user to authenticate with and access the service. This represents a single client login, and is the user-facing part of Acquire

guid()[source]

Return the global UID of the user. While the UID is highly likely to be unique, the GUID should be globally guaranteed to be unique. This is ensured by combining the UID of the user with the UID of the identity service that primarily identifies the user

identity_service()[source]

Return the identity service info object for the identity service used to validate the identity of this user

identity_service_uid()[source]

Return the UID of the identity service. The combination of user_uid+service_uid should uniquely identify this user account anywhere in the world

identity_service_url()[source]

Return the URL to the identity service. This is the full URL to the service, minus the actual function to be called, e.g. https://function_service.com/t/identity

is_empty()[source]

Return whether or not this is an empty login (so has not been used for anything yet…

is_logged_in()[source]

Return whether or not the user has successfully logged in

is_logging_in()[source]

Return whether or not the user is in the process of loggin in

login_qr_code()[source]

Return a QR code of the login URL that the user must connect to to authenticate this login session

login_url()[source]

Return the URL that the user must connect to to authenticate this login session

logout()[source]

Log out from the current session

register(password, identity_url=None)[source]

Request to register this user with the identity service running at ‘identity_url’, using the supplied ‘password’. This will return a QR code that you must use immediately to add this user on the identity service to a QR code generator

request_login(login_message=None, _is_local=False)[source]

Request to authenticate as this user. This returns a login URL that you must connect to to supply your login credentials

If ‘login_message’ is supplied, then this is passed to the identity service so that it can be displayed when the user accesses the login page. This helps the user validate that they have accessed the correct login page. Note that if the message is None, then a random message will be generated.

session_key()[source]

Return the session key for the current login session

session_uid()[source]

Return the UID of the current login session. Returns None if there is no valid login session

signing_key()[source]

Return the signing key used for the current login session

status()[source]

Return the current status of this user

uid()[source]

Return the UID of this user. This uniquely identifies the user across all systems

username()[source]

Return the username of the user

wait_for_login(timeout=None, polling_delta=5)[source]

Block until the user has logged in. If ‘timeout’ is set then we will wait for a maximum of that number of seconds

This will check whether we have logged in by polling the identity service every ‘polling_delta’ seconds.

username_to_uid(username, identity_url=None)[source]

Function to return the uid for the passed username

uid_to_username(user_uid, identity_url=None)[source]

Function to return the username for the passed uid

get_session_keys(username=None, user_uid=None, session_uid=None, identity_url=None)[source]

Function to return the session keys for the specified user