Acquire.Identity._loginsession module

class LoginSession(public_key=None, public_cert=None, ip_addr=None, hostname=None, login_message=None)[source]

Bases: object

This class holds all details of a single login session

creation_time()[source]

Return the date and time when this was created

static from_data(data)[source]

Return a LoginSession constructed from the passed data (dictionary)

hostname()[source]

Return the user-supplied hostname of the host making the login request

hours_since_creation()[source]

Return the number of hours since this request was created. This will return a float, so 1 second is 1 / 3600th of an hour

is_approved()[source]

Return whether or not this session is open and approved by the user

is_logged_out()[source]

Return whether or not this session has logged out

is_null()[source]

Return whether or not this object is null

is_suspicious()[source]

Return whether or not this session is suspicious

login()[source]

Convenience function to set the session into the logged in state

login_message()[source]

Return any login message that has been set by the user

login_time()[source]

Return the date and time when the user logged in. This returns None if the user has not yet logged in

logout()[source]

Convenience function to set the session into the logged out state

logout_time()[source]

Return the date and time when the user logged out. This returns None if the user has not yet logged out

public_certificate()[source]

Return the public certificate

public_key()[source]

Return the public key

regenerate_uid()[source]

Synonym for regenerate_uuid

regenerate_uuid()[source]

Regenerate the UUID as there has been a clash

request_source()[source]

Return the IP address of the source of this request. This is used to rate limit someone who is maliciously requesting logins…

set_approved()[source]

Register that this request has been approved

set_denied()[source]

Register that this request has been denied

set_logged_out()[source]

Register that this request has been closed as the user has logged out

set_suspicious()[source]

Put this login session into a suspicious state. This will be because weird activity has been detected which indicates that the session may be have been cracked. A login session in a suspicious state should not be granted any permissions.

short_uid()[source]

Synonym for short_uuid

short_uuid()[source]

Return a short UUID that will be used to provide a more human-readable session ID

status()[source]

Return the status of this login session

to_data()[source]

Return a data version (dictionary) of this LoginSession

static to_short_uid(long_uid)[source]

Return the short UID version of the passed long uid

uid()[source]

Synonym for uuid

uuid()[source]

Return the UUID of this request