Repository navigation
feat(audit): add the FOG 1.6 Audit Log page and the audit.view permission - #203
Merged
Merged
Conversation
…sion Add the read-only Audit Log page (GET /audit) over the AuditLog rows that the audit trail core writes, as FOG 1.6 AuditManagement shows them: the When/Who/Action/Permission/Outcome/Subject/From grid, the outcome badges, and the "Audit entry" detail modal. A "Logging" sidebar group holds it. - New permission stock.audit.view gates the page and POST /api/v1/audit/datatable. The key is `audit`, not `auditlog`, so the generic :model routes stay closed on the trail (ADR 0003 updated). - The datatable reads at most 500 rows per request and the length menu has no "All": the trail grows for the life of the install (1.6 bounds it in the query). Search is a case-insensitive substring match in the query; order is createdAt DESC, id DESC. - An allowed datatable read writes no audit row (READ_ACTIONS). - New shared helper datatables/parse-request parses the DataTables body without throwing. A JSON body with a toString object or a 1e20 start made both this endpoint and the pending-hosts datatable answer 500; the pending hosts endpoint now uses the helper too, and both get a regression test. - waitFor and sentinel move to test/support/audit-wait.js. Closes #200 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mastacontrola
added a commit
that referenced
this pull request
Nov 17, 2026
#203 (the Audit Log page) added the Logging group at the same menu and smoke-table positions as this branch's FOG Configuration entry. Keep both, FOG Configuration (150) before Logging (170). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #200. Part of the FOG 1.6 parity map (#155).
What
GET /audit: a read-only Audit Log page. It has the 1.6 grid (When, Who, Action, Permission, Outcome, Subject, From), outcome badges, and the "Audit entry" detail modal. It sits in a new "Logging" sidebar group.POST /api/v1/audit/datatable: server-side rows, newest first (createdAt DESC, id DESC). The search is a case-insensitive substring match in the query. Each request reads at most 500 rows, and the length menu has no "All".stock.audit.viewgates both. Admin roles get it, and other roles only when it is granted explicitly.Access-control notes
audit, notauditlog. So the generic/api/v1/:modelroutes still refuse the trail, even for an admin, and a test pins this.READ_ACTIONS). A denied read writes adeniedrow with permissionaudit.view./api/v1/<b>…</b>request, so a realtextrow holds markup. The check then asserts the grid and the modal show it literally.Also fixed
toStringobject or a1e20start made this endpoint answer 500.POST /api/v1/host/pending/datatablehad the same defect. Both now use the newapi/helpers/datatables/parse-request.js, and each has a regression test. DataTables never sends those bodies, so no valid input changes behavior.Review
Both reviewers ran on opus, because this change adds a permission. Round 1 had findings, and round 2 was clean on both axes. The implementation ran on sonnet.
Test
npm test(504 passing),npm run test:ui,npm run test:ui:prod.🤖 Generated with Claude Code