sqrl.exceptions module¶
-
class
sqrl.exceptions.
TIF
[source]¶ Bases:
int
SQRL
TIF
int
subclass which can represent SQRLTIF
flags.Example
>>> tif = TIF(TIF.IP_MATCH | TIF.TRANSIENT_FAILURE | TIF.COMMAND_FAILED) >>> tif.is_ip_match True >>> tif.is_id_match False >>> tif.is_transient_failure True >>> tif 100 >>> tif.as_hex_string() '64' >>> tif.breakdown() == { ... 'id_match': False, ... 'previous_id_match': False, ... 'ip_match': True, ... 'sqrl_disabled': False, ... 'not_supported': False, ... 'transient_failure': True, ... 'command_failed': True, ... 'client_failure': False, ... } True
-
BAD_ID_ASSOCIATION
= 256¶ SQRL Identity is already a ssociated with a different account
-
CLIENT_FAILURE
= 128¶ SQRL command failed because SQRL client sent invalid data
-
COMMAND_FAILED
= 64¶ SQRL command failed for any reason
-
ID_MATCH
= 1¶ SQRL ID was found in DB
-
IP_MATCH
= 4¶ SQRL client is used from same IP as where transaction started
-
NOT_SUPPORTED
= 16¶ SQRL client requested SQRl operation which is not supported
-
PREVIOUS_ID_MATCH
= 2¶ Previous SQRL ID was found in DB
-
SQRL_DISABLED
= 8¶ SQRL auth is disabled for the found SQRL identity as per users request
-
TRANSIENT_FAILURE
= 32¶ SQRL command failed transiently. Most likely restarting SQRL transaction should fix this
-
breakdown
()[source]¶ Returns a full breakdown of the TIF value.
Returns: Keys are the SQRL TIF property and values are booleans. Return type: dict
-
is_bad_id_association
¶ Property which returns boolean whether
0x100
or0b100000000
bit is present in the TIF value.
-
is_client_failure
¶ Property which returns boolean whether
0x80
or0b10000000
bit is present in the TIF value.
-
is_command_failed
¶ Property which returns boolean whether
0x40
or0b1000000
bit is present in the TIF value.
-
is_id_match
¶ Property which returns boolean whether
0x1
or0b1
bit is present in the TIF value.
-
is_ip_match
¶ Property which returns boolean whether
0x4
or0b100
bit is present in the TIF value.
-
is_not_supported
¶ Property which returns boolean whether
0x10
or0b10000
bit is present in the TIF value.
-
is_previous_id_match
¶ Property which returns boolean whether
0x2
or0b10
bit is present in the TIF value.
-
is_sqrl_disabled
¶ Property which returns boolean whether
0x8
or0b1000
bit is present in the TIF value.
-
is_transient_failure
¶ Property which returns boolean whether
0x20
or0b100000
bit is present in the TIF value.
-