linotp.lib.config.config_class module

LinOTP Configuration class.

a dictionary to hold the linotp configuration entries with - a database back-end and - application wide synchronization

class linotp.lib.config.config_class.LinOtpConfig

Bases: dict

LinOTP Config class - a dictionary to hold the config entries with a backend database

This class should be a request singleton.

In case of a change, it must cover the different aspects like

  • env config entry

  • and app_globals

  • and finally sync this to disc

addEntry(key, val, typ=None, des=None)

small wrapper, as the assignement opperator has only one value argument

Parameters
  • key (string) – key of the dict

  • val (any type) – any value, which is put in the dict

  • typ (None,string,password) – used in the database to control if the data is encrypted

  • des (string) – literal, which describes the data

get(key, default=None)

check for a key in the linotp config

remark: the config entries all start with linotp. if a key is not found, we do a check if there is a linotp. prefix set in the key and potetialy prepend it

Parameters
  • key (string) – search value

  • default (any type) – default value, which is returned, if the value is not found

Returns

value or None

Return type

any type

getRealms()
has_key(key)
refreshConfig(do_reload=False)
setRealms(realmDict)
update(dic)

update the config dict with multiple items in a dict

Parameters

dic (dict) – dictionary of multiple items

:return : return the std value like the std dict does, whatever this is :rtype : any value a dict update will return