Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

forge-mvc-audit

Journal d'audit applicatif opt-in pour Forge : tracer les actions importantes de l'application (élève créé, note modifiée, QCM corrigé, connexion, rôle changé, fichier supprimé) dans une table audit_log, avec une API explicite.

Périmètre volontairement borné : c'est un audit applicatif, pas un SIEM de cybersécurité. Cohérent avec ADR-008 : Forge fournit la table et le helper, la décision de tracer reste applicative.

Installation

pip install --pre forge-mvc-audit

En développement : pip install -e ./packages/forge-mvc-audit.

Mise en place de la table

forge audit:init        # copie la migration dans mvc/migrations/
forge migration:apply   # crée la table audit_log

Utilisation

from forge_mvc_audit import record_audit, get_audit_log

record_audit("eleve.cree", actor="prof.dupont", target_type="eleve", target_id=42)
record_audit("note.modifiee", actor="prof.dupont", target_type="note", target_id=7, details="12 -> 15")

for entree in get_audit_log(limit=20, actor="prof.dupont"):
    print(entree.created_at, entree.action, entree.target_type, entree.target_id)

L'API expose record_audit, get_audit_log, AuditEntry, plus AuditError, TABLE_NAME, MAX_LIMIT et CREATE_TABLE_SQL.

Périmètre

  • record_audit(action, *, actor, target_type, target_id, details, db) écrit une trace et renvoie son identifiant.
  • get_audit_log(*, limit, actor, action, target_type, target_id, db) relit les entrées récentes, filtrables (colonnes en liste blanche).
  • Hors périmètre : corrélation d'événements, alerting, rétention automatique, détection d'intrusion (ce n'est pas un SIEM).

Documentation complète : https://forgemvc.com/docs/forge/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forge_mvc_audit-1.0.0rc2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forge_mvc_audit-1.0.0rc2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file forge_mvc_audit-1.0.0rc2.tar.gz.

File metadata

  • Download URL: forge_mvc_audit-1.0.0rc2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for forge_mvc_audit-1.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 5b63cf5fdc130807ec0e8b7d73f6bc2291f7dca9a0f405a0296647fcc2671e91
MD5 6dfb91b980441d679124d120ad98c514
BLAKE2b-256 5dbf1b459b52877a6bf69f27a84530dbf90fe54ba55adb569912daceb0fcd465

See more details on using hashes here.

File details

Details for the file forge_mvc_audit-1.0.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for forge_mvc_audit-1.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5dfe5b897b5d44ed9d057238820eb43183b466c8cf5a6c40b5a65e956d1fa12
MD5 725a195c5996ecbaa8dce194672de28d
BLAKE2b-256 51af2720970bab01b58f7928a0625f1f11e98840f9029c395880af0ca2459b45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page