linotp.tokens.base.validity_mixin module

class linotp.tokens.base.validity_mixin.TokenValidityMixin

Bases: object

A mixin for the Token validity handling which could be

  • time based with

** start and end validity period

  • counter based with

** access counter based ** success counter based

Stored values are

for the success counters:

count_auth_success_max count_auth_success

for the access counters:

count_auth_max count_auth

for the time period:

validity_period_start validity_period_end

TODO: currently the validity info is stored in the token info

but in a redesign could be moved into a dedicated table or column

property count_auth
property count_auth_max
property count_auth_success

getter for the count_auth_success

property count_auth_success_max

get the counter for the maximum allowed successful logins

del_count_auth()

delete the access counter

del_count_auth_max()

delete the access counter

del_count_auth_success_max()

delete the success access counter

del_validity_period_end()

delete the end date of the validity period for a token

del_validity_period_start()

delete the start date of the validity period for a token

has_exceeded_success()
has_exceeded_usage()
inc_count_auth()

increment the access counter

inc_count_auth_success()

increment the auth success counter

is_expired()
is_not_yet_valid()
is_valid()
property validity_period_end

returns the end of validity period (if set)

property validity_period_start

returns the start of validity period (if set)