Commit Graph
9 Commits
Author SHA1 Message Date
Paul FaureandClaude Opus 5.5 be21f76688 feat(audit): record tag changes in the audit log (#13055)
* feat(audit): record tag changes in the audit log

Graph publishes TagsAdded and TagsRemoved on every tag assign and unassign,
but only the search service listened, so a tag change left no trace in the
audit log.

The audit service now registers both events and logs them as file_tags_add
and file_tags_remove, with the acting user (Executant), the space owner, the
file id and path, and the comma-separated tags. Graph sets the Timestamp on
both events, which it left unset. Two test cases use different owner and
actor ids; the audit README documents the two actions.

Fixes #13054

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Paul Faure <paul@faure.ca>

* fix(audit): record only the tags that actually changed; skip no-op tag events

Review follow-up for #13055:
- graph: TagsAdded/TagsRemoved now carry the tags that were actually added
  or removed (requesting an existing tag, or removing an absent one, is not
  a change). Search only uses the event's Ref, so it is unaffected.
- audit: skip tag events whose tag list is empty. Graph still publishes
  TagsRemoved for search when nothing was present; that is not an audit event.
- audit: document why User is the executant for tag events; describe Tags
  as carried by the event; remove a stray copy-pasted doc comment.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpoeSoKYEdgQcWjEzTVKpT
Signed-off-by: Paul Faure <paul@faure.ca>

* fix(audit): carry the requested tags in tag events, as before

Per review: TagsAdded/TagsRemoved go back to carrying the tags as
requested, and the audit log records every request, including tags that
were already present (or absent, for a removal), so repeated requests stay
visible. Computing the actual delta belongs in the tags package, not here.

Removes the graph-side tagsDiff helper and its test, and the audit
service's skip for empty tag lists. The other review fixes stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpoeSoKYEdgQcWjEzTVKpT
Signed-off-by: Paul Faure <paul@faure.ca>

---------

Signed-off-by: Paul Faure <paul@faure.ca>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-09 09:54:17 +02:00
Martin 9e5f18b6d9 Fix typo in audit service readme
References: https://github.com/owncloud/docs-ocis/pull/452

`autit` --> `audit`
2023-04-14 09:30:24 +02:00
mmattel b2504035e0 fix readme service names 2023-04-12 18:40:41 +02:00
David Christofas 23a41f7d0f renaming of the simple format 2022-11-30 16:32:49 +01:00
mmattel a0c06d733d update readme 2022-11-30 16:24:57 +01:00
Martin 35e5c6aeda Update services/audit/README.md 2022-11-30 16:18:25 +01:00
Edith Parzefall ced6820d7a Update services/audit/README.md 2022-11-30 15:41:41 +01:00
Edith ParzefallandMartin e554f7b4ee Apply suggestions from code review
Co-authored-by: Martin <github@diemattels.at>
2022-11-30 15:39:54 +01:00
David Christofas 943e9dfbba add a README to the audit package 2022-11-30 13:28:40 +01:00