Skip to content

Add audit logs#647

Draft
varmar05 wants to merge 1 commit into
masterfrom
audit_logs
Draft

Add audit logs#647
varmar05 wants to merge 1 commit into
masterfrom
audit_logs

Conversation

@varmar05

@varmar05 varmar05 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Introduce a pluggable audit module with NullSink default and emit() API.

Wire SQLAlchemy listeners for user and project lifecycle events, explicit emits for auth and sync endpoints (login, password, access grants/revocations, version push, soft/hard delete, restore).

Add actor_context()/request_context() helpers, device_id capture, scope_id for workspace-scoped filtering, and target_type auto-derivation.

Introduce a pluggable audit module with NullSink default and emit() API.

Wire SQLAlchemy listeners for user and project lifecycle events,
explicit emits for auth and sync endpoints (login, password, access
grants/revocations, version push, soft/hard delete, restore).

Add actor_context()/request_context() helpers, device_id capture, scope_id
for workspace-scoped filtering, and target_type auto-derivation.

This is groundwork for adding more events and to be extended in EE with custom sinks, query API, and retention policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 28499418090

Coverage increased (+0.2%) to 92.323%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: 7 uncovered changes across 2 files (294 of 301 lines covered, 97.67%).
  • 2 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
server/mergin/utils.py 12 8 66.67%
server/mergin/audit/listeners.py 38 35 92.11%
Total (24 files) 301 294 97.67%

Coverage Regressions

2 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
server/mergin/sync/utils.py 2 85.2%

Coverage Stats

Coverage Status
Relevant Lines: 10304
Covered Lines: 9513
Line Coverage: 92.32%
Coverage Strength: 0.92 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants