nside_wefa.audit.api¶
Public Python API for emitting audit events.
Two surfaces:
log()— write an explicit event (login attempts, business actions, permission denials, anything not tied to a model save).set_actor()— re-export of auditlog’s context manager so consumers can attribute events written outside a request, e.g. inside Celery tasks.
The Outcome enum is stored in LogEntry.additional_data["outcome"]
so login successes, failures, and permission denials can co-exist in the
same table.
Failure handling is governed by NSIDE_WEFA.AUDIT.RAISE_ON_FAILURE (default
False): write errors are caught, logged as a warning, and log()
returns None. Set the flag to True in tests to surface regressions.
Functions
|
Write an audit event and return the resulting log entry. |
|
Re-export of |
Classes
|
Coarse-grained outcome label stored alongside each event. |
Exceptions
|
Raised when |