Skip to content

feat(admin_audit): add stable operation identifier to audit log entries - #65007

Open
GhassenKefi wants to merge 3 commits into
masterfrom
feat/admin-audit-operation-id
Open

GhassenKefi wants to merge 3 commits into
masterfrom
feat/admin-audit-operation-id

Conversation

@GhassenKefi

@GhassenKefi GhassenKefi commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Every audit log entry now carries a machine-readable "operation" field (e.g. "files.file.read") in its data, next to the human-readable message. Log consumers can filter on it instead of matching message text, which may change between releases.

The names are defined once in the new OCA\AdminAudit\Operation enum. CriticalActionPerformedEvent gets an optional $operation parameter so other apps can provide their own.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@GhassenKefi
GhassenKefi requested a review from a team as a code owner October 2, 2026 10:01
@GhassenKefi
GhassenKefi requested review from icewind1991, leftybournes, provokateurin and salmart-dev and removed request for a team October 2, 2026 10:01
@GhassenKefi
GhassenKefi requested a review from susnux October 2, 2026 10:02
@GhassenKefi GhassenKefi added this to the Nextcloud 36 milestone Oct 2, 2026
@GhassenKefi GhassenKefi self-assigned this Oct 2, 2026
Comment thread lib/public/Log/Audit/CriticalActionPerformedEvent.php
@GhassenKefi
GhassenKefi force-pushed the feat/admin-audit-operation-id branch from 55781f7 to a4ad156 Compare October 5, 2026 11:43

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, but could you please split the commit into:

  1. the change on the public event
  2. the actual changes on the event dispatching

…edEvent

Callers can pass a stable identifier of the audited action in the form
`app.entity.action` (e.g. "federatedfilesharing.share.accepted") as the
new optional fourth constructor parameter. It is exposed through
getOperation(). Values not in that form are rejected with an
InvalidArgumentException. Existing callers are unaffected.

Refs nextcloud-gmbh/governance#199

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
Every audit log entry now carries a machine-readable "operation" field
(e.g. "files.file.read") in its data, next to the human-readable message.
Log consumers can filter on it instead of matching message text, which
may change between releases.

The names are defined once in the new OCA\AdminAudit\Operation enum.
Operations passed by other apps through CriticalActionPerformedEvent are
written as given.

Refs nextcloud-gmbh/governance#199

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Ghassen kefi <ghassen.kefi.dev@gmail.com>
@GhassenKefi
GhassenKefi force-pushed the feat/admin-audit-operation-id branch from a4ad156 to 03b51ed Compare October 6, 2026 13:57
Signed-off-by: kefi ghassen <84786282+GhassenKefi@users.noreply.github.com>

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants