Repository navigation
feat(hub): connect administrator security audit - #216
Conversation
f5f65f4 to
b87988a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Valid provider keys can break audit-page validation, while route matching and expired-session handling can send users to unimplemented APIs.
8 open issues
Match audit paths using router-compatible semantics · New Handle signed-out audit visits without redirecting to a broken endpoint · New Allow dotted provider keys through credential-shape validation · New Assert audit requests against an allowlist of real endpoints · New Use a non-credential value to isolate sensitive-key validation · New Test each invalid field independently · New Replace the mock-facing audit label with product copy · New Use product-facing personas and event details in repository stories · New
What changed in this PR
Connects the retained Security audit page to Hub’s live administrator session and audit API without loading the provisional product workspace.
Changes:
- Adds real-mode audit loading, opaque cursor pagination, access checks, and visible failure handling.
- Displays stable membership UUIDs and structured context while retaining mock repository audit fixtures.
- Adds contract, request, rendering, and route coverage, plus updated stories and documentation.
| File | Description |
|---|---|
hub/docs/frontend.md |
Documents real audit routes and mock boundaries. |
hub/docs/authentication.md |
Describes audit access, pagination, and failures. |
hub/docs/architecture.md |
Updates the audit frontend’s architecture boundary. |
hub/client/pages/security-audit-page/types.ts |
Defines string record IDs and structured context. |
hub/client/pages/security-audit-page/styles.css |
Styles the revised table and context fields. |
hub/client/pages/security-audit-page/stories.tsx |
Updates Hub and repository audit examples. |
hub/client/pages/security-audit-page/index.tsx |
Renders labeled context fields and empty details. |
hub/client/pages/security-audit-page/index.test.tsx |
Checks safe rendering of action and context text. |
hub/client/application/hub/view-models/settings-audit/index.ts |
Adapts mock records to the revised page props. |
hub/client/application/hub/view-models/security-audit-page-data/index.ts |
Maps real audit responses to presentation data. |
hub/client/application/hub/view-models/security-audit-page-data/index.test.ts |
Covers record mapping and opaque pagination. |
hub/client/application/hub/view-models/administrator-workspace/index.ts |
Adds administrator navigation to the audit page. |
hub/client/application/hub/security-audit-contracts/types.ts |
Exposes the inferred audit response type. |
hub/client/application/hub/security-audit-contracts/index.ts |
Validates audit records and bounded context. |
hub/client/application/hub/security-audit-contracts/index.test.ts |
Exercises response validation rules. |
hub/client/application/hub/routes/settings-audit/index.tsx |
Adds real-mode loading and read-only route handling. |
hub/client/application/hub/routes/security-audit-flow.test.tsx |
Covers pagination, access, and request failures. |
hub/client/application/hub/requests/get-security-audits/index.ts |
Requests 50 records with an optional cursor. |
hub/client/application/hub/requests/get-security-audits/index.test.ts |
Checks pagination query construction. |
hub/client/application/hub/is-administrator-route/index.ts |
Classifies audit navigation as an administrator route. |
Review effort: Max (auto)
There was a problem hiding this comment.
🟡 Changes recommended
The actor fallback incorrectly treats missing actor data as evidence that nobody was signed in, mislabeling authenticated audit events.
4 open issues
7 resolved since last review
Allow dotted provider keys through credential-shape validation Match audit paths using router-compatible semantics Use product-facing personas and event details in repository stories Replace the mock-facing audit label with product copy Test each invalid field independently Use a non-credential value to isolate sensitive-key validation Assert audit requests against an allowlist of real endpoints
Review effort: Max (auto)
aa26a39 to
d875920
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
d875920 to
6532f37
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Fixed the audit-table overflow in |



Why
Hub administrators need to read the security records exposed by the new Hub-wide audit API without loading the provisional product workspace.
What changes
The retained Security audit page now uses the real administrator session and
/api/security-auditsin real mode. It keeps the server cursor opaque in thebeforeURL parameter, shows stable membership UUIDs and allowlisted context, and leaves request and contract failures visible.Mock mode keeps its Hub and repository fixtures. Production repository audit, export, retention controls, deletion, and session revocation remain deferred.
Storybook screenshots
Hub-wide audit states
Hub/Pages/Security/Audit — Empty — dark theme — 1280×800
Hub/Pages/Security/Audit — Hub Only — dark theme — 1280×800
Hub/Pages/Security/Audit — Scopes Unavailable — dark theme — 1280×800
Hub/Pages/Security/Audit — Authorization Succeeded — dark theme — 1280×800
Hub/Pages/Security/Audit — Single — dark theme — 1280×800
Hub/Pages/Security/Audit — Multiple — dark theme — 1280×800
Mock repository audit fixtures
Hub/Pages/Security/Audit — Repository — dark theme — 1280×800
Hub/Pages/Security/Audit — Repository Empty — dark theme — 1280×800
Hub/Pages/Security/Audit — Repository And Hub Admin — dark theme — 1280×800