Skip to content

feat(hub): connect administrator security audit - #216

Merged
alliscode merged 6 commits into
build/hub/newfrom
alliscode-hub-audit-frontend
Nov 10, 2026
Merged

alliscode merged 6 commits into
build/hub/newfrom
alliscode-hub-audit-frontend

Conversation

@alliscode

@alliscode alliscode commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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-audits in real mode. It keeps the server cursor opaque in the before URL 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

Empty Hub security audit

Hub/Pages/Security/Audit — Hub Only — dark theme — 1280×800

Hub-only empty security audit

Hub/Pages/Security/Audit — Scopes Unavailable — dark theme — 1280×800

Security audit with unavailable repository scopes

Hub/Pages/Security/Audit — Authorization Succeeded — dark theme — 1280×800

Security audit authorization notice

Hub/Pages/Security/Audit — Single — dark theme — 1280×800

Single Hub security audit record

Hub/Pages/Security/Audit — Multiple — dark theme — 1280×800

Multiple Hub security audit records

Mock repository audit fixtures

Hub/Pages/Security/Audit — Repository — dark theme — 1280×800

Repository security audit fixture

Hub/Pages/Security/Audit — Repository Empty — dark theme — 1280×800

Empty repository security audit fixture

Hub/Pages/Security/Audit — Repository And Hub Admin — dark theme — 1280×800

Repository security audit fixture for a Hub administrator

@alliscode
alliscode requested review from a team and nshki as code owners November 10, 2026 18:05
Copilot AI adaptive review requested due to automatic review settings November 10, 2026 18:05
@alliscode
alliscode added this pull request to stack #217 November 10, 2026 18:07
@alliscode
alliscode force-pushed the alliscode-hub-audit-frontend branch from f5f65f4 to b87988a Compare November 10, 2026 18:21

Copilot AI 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.

🟡 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
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)

Copilot AI 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.

@alliscode
alliscode force-pushed the alliscode-hub-audit-frontend branch from aa26a39 to d875920 Compare November 10, 2026 19:44

@nshki nshki 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.

Thanks Ben.

Looks like this screen got a little wonky with some overflowing text. Let's make sure we account for that before merging.

Base automatically changed from alliscode-hub-security-audit-api to build/hub/new November 10, 2026 23:17
Ben Thomas and others added 5 commits November 10, 2026 15:17
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>
@alliscode
alliscode force-pushed the alliscode-hub-audit-frontend branch from d875920 to 6532f37 Compare November 10, 2026 23:17
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode

Copy link
Copy Markdown
Contributor Author

Fixed the audit-table overflow in 475c5d00. The table now uses fixed responsive column proportions, stacks context labels above values, and keeps narrow viewports inside the existing horizontal scroll region. I re-rendered the affected Single, Multiple, Repository, and Repository And Hub Admin stories at the same dark-theme 1280×800 viewport and replaced those four screenshots in the PR description.

@alliscode
alliscode merged commit c6cfa0b into build/hub/new Nov 10, 2026
32 checks passed
@alliscode
alliscode deleted the alliscode-hub-audit-frontend branch November 10, 2026 23:45
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.

3 participants