6.1.1.3.2.5. linotp.lib.config module¶
handle all configuration items with aspekts like persitance and syncronysation and provides this to all requests
- class linotp.lib.config.LinOtpConfig(*args, **kw)[source]¶
Bases: dict
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)[source]¶
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)[source]¶
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
- linotp.lib.config.getLinotpConfig()[source]¶
return the thread local dict with all entries
Returns: local config dict Return type: dict