fix(dashboard): enforce page [Authorize] on in-circuit navigation via AuthorizeRouteView (DSH-001, #243)
Routes.razor used RouteView, which ignores [Authorize]. With the interactive router, an in-circuit navigation never meets endpoint authorization, so anonymous localhost could open /alarms and a Viewer could open /admin/secrets (secret metadata list). Both were confirmed reachable by the new route test before the change; AuthorizeRouteView now renders a Not Authorized panel instead.
This commit is contained in:
@@ -627,6 +627,15 @@ policy `AlarmsHub` carries — the two read one central monitor and must not dis
|
||||
may see it — and the side rail hides the Alarms link for callers the policy denies. What a
|
||||
permitted caller sees is galaxy-wide and not tag-scoped; see "Alarm-feed visibility".
|
||||
|
||||
The attribute is enforced on both routes into the page. A full HTTP request meets endpoint
|
||||
authorization. An in-circuit navigation (an in-page link, or `Blazor.navigateTo` from the
|
||||
console) issues no HTTP request, so `Routes.razor` renders pages through `AuthorizeRouteView`,
|
||||
which evaluates the page's `[Authorize]` attribute against the circuit's principal and renders a
|
||||
"Not Authorized" panel instead. Before DSH-001 (#243) the router used a plain `RouteView`, so an
|
||||
anonymous-localhost caller could reach this page, and a Viewer could reach the mounted Secrets
|
||||
page (`/admin/secrets`, `secrets:manage`) and its secret-metadata list, by navigating inside an
|
||||
existing circuit.
|
||||
|
||||
### Live data source
|
||||
|
||||
Both the Browse subscription panel and the Alarms page read live MXAccess data
|
||||
@@ -817,8 +826,10 @@ they do not use.
|
||||
The in-process page feeds carry no authentication of their own, and need none:
|
||||
`MapRazorComponents<App>()` applies `RequireAuthorization(ViewerPolicy)` to the
|
||||
component endpoints, so a page can only run inside a circuit whose principal is
|
||||
already an authorized Viewer. The hub-token flow below therefore covers only the
|
||||
remote hub surface.
|
||||
already an authorized Viewer. Pages with a stricter `[Authorize]` attribute (Alarms,
|
||||
the mounted Secrets page) are re-checked by `AuthorizeRouteView` on every in-circuit
|
||||
navigation, because that navigation never reaches the endpoint. The hub-token flow
|
||||
below therefore covers only the remote hub surface.
|
||||
|
||||
Neither policy scopes a Viewer to particular sessions — that is
|
||||
`IDashboardSessionAcl`'s job (SEC-25 / TST-15), consulted by both subscribe seams:
|
||||
|
||||
Reference in New Issue
Block a user