Skip to content

feat(web): owner-wide activity log query for the audit-log dump#131

Merged
obcode merged 1 commit into
mainfrom
feat/activity-log-dump
Jul 20, 2026
Merged

feat(web): owner-wide activity log query for the audit-log dump#131
obcode merged 1 commit into
mainfrom
feat/activity-log-dump

Conversation

@obcode

@obcode obcode commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Kleinkram: das Audit-Log-Dump (Backend-Teil). Der GUI-Teil (/activity-Seite + JSON-Download) folgt in glabs.gui.

Inhalt

  • activityLog: [ActivityEntry!]! — der komplette Verlauf des Aufrufers über alle Kurse, neueste zuerst, ungecappt (die per-Assignment-/per-Kurs-Reads bleiben bei 200; ein Dump muss vollständig sein, und der Audit-Trail eines Users ist praktisch beschränkt). Owner-scoped wie alles.
  • ActivityEntry exponiert jetzt zusätzlich course (nötig, um kurs-übergreifende Einträge zu unterscheiden).
  • db.AllActivityFor(owner) — owner-only-Read über das jetzt limit-parametrisierte findActivity (Invariante „kein Read ohne Owner-Filter" bleibt); neuer Index {owner:1, at:-1}.
  • app.ActivityLog + Resolver; toGraphActivity mappt course.

Verifikation

  • go build/go vet/go vet -tags=integration/go test ./.../golangci-lint — alle grün.
  • Neuer App-Test: kurs-übergreifender Dump (3 Einträge über 2 Kurse) + Auth-Pflicht.
  • Backend-Smoke gegen Wegwerf-Mongo: { activityLog { course op status at } }{"data":{"activityLog":[]}} (Query serviert real).

🤖 Generated with Claude Code

Add `activityLog: [ActivityEntry!]!` — the caller's complete activity log
across ALL their courses, newest first, UNCAPPED (the per-assignment and
per-course reads stay capped at 200; a dump must be complete, and one
user's audit trail is bounded in practice). ActivityEntry now also exposes
`course`, needed to tell cross-course entries apart.

- db.AllActivityFor(owner): owner-only read via the shared, now
  limit-parameterised findActivity; a new {owner:1, at:-1} index backs it.
- app.ActivityLog + resolver; toGraphActivity maps course.

Backs the /activity page and its JSON download in glabs.gui.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obcode
obcode merged commit 5302faa into main Jul 20, 2026
8 checks passed
@obcode
obcode deleted the feat/activity-log-dump branch July 20, 2026 12:53
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