linotp.lib.audit.base module

This is the BaseClass for logging Audit Trails

class linotp.lib.audit.base.AuditBase(config)[source]

Bases: object

getAuditId()[source]
getTotal(param, AND=True, display_error=True)[source]

This method returns the total number of audit entries in the audit store

initialize(request, client=None)[source]
initialize_log(param)[source]

This method initialized the log state. The fact, that the log state was initialized, also needs to be logged. Therefor the same params are passed as i the log method.

log(param)[source]

This method is used to log the data. It should hash the data and do a hash chain and sign the data

readKeys()[source]
search(param, AND=True, display_error=True, rp_dict=None)[source]

This function is used to search audit events.

param:
Search parameters can be passed.
return:
A list of dictionaries is return. Each list element denotes an audit event.
searchQuery(param, AND=True, display_error=True, rp_dict=None)[source]

This function is used to search audit events.

param:
Search parameters can be passed.
return:
An iterator is returned.
set()[source]

This function could be used to set certain things like the signing key. But maybe it should only be read from linotp.ini?

linotp.lib.audit.base.getAudit(config)[source]
linotp.lib.audit.base.getAuditClass(packageName, className)[source]

helper method to load the Audit class from a given package in literal:

example:

getAuditClass(“SQLAudit”, “Audit”)
check:
checks, if the log method exists if not an error is thrown
linotp.lib.audit.base.logTokenNum(audit)[source]

add the current token count to the audit dict

Parameters:audit – audit dict
linotp.lib.audit.base.search(param, user=None, columns=None)[source]