s365b.core.audit

Writing the audit log.

Every security-relevant action (sign-in, settings change, restore, export) is recorded with who did it, from where, and what changed. Rows are only ever inserted.

Functions

audit(s, actor, action, *[, target, details, ip]) → None

Append an audit record.

Module Contents

async s365b.core.audit.audit(s: sqlalchemy.ext.asyncio.AsyncSession, actor: str, action: str, *, target: str = '', details: dict[str, Any] | None = None, ip: str | None = None) → None[source]

Append an audit record.

Parameters:
  • s – Open session; the caller commits.

  • actor – Username, system or anonymous.

  • action – Dotted action name, e.g. auth.login.local.

  • target – What was acted on.

  • details – Extra structured details. Never include secrets.

  • ip – Client IP address.