Skip to content

[M2.4b] Web: audit log with filters, paging and export - #183

Merged
samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.4b-audit-screen
Nov 7, 2026
Merged

samuelmbabhazi merged 1 commit into
mainfrom
feat/m2.4b-audit-screen

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

What changed

The organization page links to a new audit log screen (/orgs/:id/audit):

  • Events newest first, with time, action, actor, target, IP and metadata on demand.
  • Filters for action, target type, target ID, actor ID and a period.
  • "Load older events" pages through the cursor.
  • "Export as JSON Lines" downloads what the applied filters select, and says so when the 10,000-event export was cut short.

Why

PLAN M2.4b. The read and export routes existed (M2.4a) without a screen.

How it was tested

Web tests in audit-page.spec.ts, run through the real routes with a stubbed fetch:

  • Metadata holding markup renders as text.
  • Only filled filters are sent, and the period goes out in UTC.
  • Injection-like filter values and a reversed period send no request.
  • A failed page keeps the events already shown.
  • A stale answer for replaced filters is dropped.
  • Export uses the applied filters, not typed ones, and a failed export saves nothing.

Local gate only (CI off). Not exercised in a real browser or against a running API. The Blob download is stubbed in the tests.

Security considerations

The screen adds no route and uses the existing audit.read checks: a member without it gets the API's refusal. Filter patterns match the API's, which remains the authority. Angular interpolation escapes all event fields. The export is held in memory only long enough to hand to the browser.

Checklist

  • Tests, including malicious input
  • No new shell invocation, no new secret exposure path
  • No state change, so no new audit event
  • PLAN updated

@samuelmbabhazi
samuelmbabhazi merged commit d4552a4 into main Nov 7, 2026
@samuelmbabhazi
samuelmbabhazi deleted the feat/m2.4b-audit-screen branch November 7, 2026 11:45
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.

1 participant