6.1.1.4. linotp.model package

6.1.1.4.2. Module contents

This file contains the database definition / database model for linotp objects

class linotp.model.Challenge(transid, tokenserial, challenge=u'', data=u'', session=u'')[source]

Bases: object

the generic challange handling

challenge
classmethod createTransactionId(length=20)[source]
data
get(key=None, fallback=None, save=False)[source]

simulate the dict behaviour to make challenge processing easier, as this will have to deal as well with ‘dict only challenges’

Parameters:
  • key – the attribute name - in case of key is not provided, a dict of all class attributes are returned
  • fallback – if the attribute is not found, the fallback is returned
  • save – in case of all attributes and save==True, the timestamp is converted to a string representation
getChallenge()[source]
getData()[source]
getId()[source]
getSession()[source]
getTanCount()[source]
getTanStatus()[source]
getTokenSerial()[source]
getTransactionId()[source]
get_vars(save=False)[source]

return a dictionary of all vars in the challenge class

Returns:dict of vars
id
received_count
received_tan
save()[source]

enforce the saveing of a challenge - will guarentee the uniqness of the transaction id

Returns:transaction id of the stored challeng
session
setChallenge(challenge)[source]
setData(data)[source]
setSession(session)[source]
setTanStatus(received=False, valid=False)[source]
timestamp
tokenserial
transid
valid_tan
class linotp.model.Config(Key, Value, Type=u'', Description=u'')[source]

Bases: object

Description
Key
Type
Value
class linotp.model.OcraChallenge(transId, challenge, tokenserial, data, session=u'')[source]

Bases: object

challenge
data
getChallenge()[source]
getData()[source]
getSession()[source]
getTanStatus()[source]
getTransactionId()[source]
id
received_count
received_tan
save()[source]
session
setChallenge(challenge)[source]
setData(data)[source]
setSession(session)[source]
setTanStatus(received=False, valid=False)[source]
timestamp
tokenserial
transid
valid_tan
class linotp.model.Realm(realm)[source]

Bases: object

default
id
name
option
storeRealm()[source]
class linotp.model.Token(serial)[source]

Bases: object

LinOtpCount
LinOtpCountWindow
LinOtpFailCount
LinOtpIdResClass
LinOtpIdResolver
LinOtpIsactive
LinOtpKeyEnc
LinOtpKeyIV
LinOtpMaxFail
LinOtpOtpLen
LinOtpPinHash
LinOtpSeed
LinOtpSyncWindow
LinOtpTokenDesc
LinOtpTokenId
LinOtpTokenInfo
LinOtpTokenPinSO
LinOtpTokenPinSOIV
LinOtpTokenPinUser
LinOtpTokenPinUserIV
LinOtpTokenSerialnumber
LinOtpTokenType
LinOtpUserid
addRealm(realm)[source]
comparePin(pin)[source]
deleteToken()[source]
get(key=None, fallback=None, save=False)[source]

simulate the dict behaviour to make challenge processing easier, as this will have to deal as well with ‘dict only challenges’

Parameters:
  • key – the attribute name - in case of key is not provided, a dict of all class attributes are returned
  • fallback – if the attribute is not found, the fallback is returned
  • save – in case of all attributes and save==True, the timestamp is converted to a string representation
getCountWindow()[source]
getHOtpKey()[source]
getHashedPin(pin)[source]
getInfo()[source]
getOtpCounter()[source]
getPin()[source]
getRealmNames()[source]
getRealms()[source]
getSerial()[source]
getSyncWindow()[source]
getType()[source]
getUserPin()[source]
get_vars(save=False)[source]
isPinEncrypted(pin=None)[source]
realms
setCountWindow(counter)[source]
setDescription(desc)[source]
setHKey(hOtpKey, reset_failcount=True)[source]
setHashedPin(pin)[source]
setInfo(info)[source]
setOtpLen(otplen)[source]
setPin(pin, hashed=True)[source]
setRealms(realms)[source]
setSoPin(soPin)[source]
setType(typ)[source]
setUserPin(userPin)[source]
storeToken()[source]
updateOtpKey(otpKey)[source]
updateToken(tokenDesc, otpKey, pin)[source]
updateType(typ)[source]
class linotp.model.TokenRealm(realmid)[source]

Bases: object

id
realm_id
token_id
linotp.model.createToken(serial)[source]
linotp.model.init_model(engine)[source]

init_model binds the table objects to the class objects - to be called before using any of the tables or classes in the model!!!

Parameters:engine – the sql engine