Removal plan has no auth step: deleting the last challenged Blazor page leaves only the open SPA #206

Closed
opened 2026-07-09 21:21:54 +02:00 by timothy · 3 comments
Owner

Severity: SHOULD-FIX (confirm-before-deletion, not necessarily a build blocker)

What's wrong

Phase (a)'s own merge comment flagged: "OIDC installs now land on the open SPA instead of a challenged Blazor page … SPA auth is a phase-(b) design item." The phase-(b) removal plan (Steps 1–3) contains no auth step — it deletes Index.razor (/system/health, the last Blazor-served page that could sit behind a challenge) without addressing SPA authentication.

If any deployment relied on the Blazor page's auth challenge as a gate, deleting it removes that surface while the plan silently assumes "auth is handled elsewhere." GET APIs and /app were already unauthenticated in phase (a), so this may be no new exposure — but the removal plan should not clear the gate on an unstated assumption.

Required (recommended)

Before Step 2, explicitly confirm the auth posture: enumerate what (if anything) was still behind a Blazor auth challenge, confirm the SPA + API access-control model covers it, and either add an auth step to the plan or record an explicit "no auth regression — GET APIs/SPA already open, verified" sign-off. Don't let the gate clear by omission.

**Severity: SHOULD-FIX** (confirm-before-deletion, not necessarily a build blocker) ## What's wrong Phase (a)'s own merge comment flagged: *"OIDC installs now land on the open SPA instead of a challenged Blazor page … SPA auth is a phase-(b) design item."* The phase-(b) removal plan (Steps 1–3) contains **no auth step** — it deletes `Index.razor` (`/system/health`, the last Blazor-served page that could sit behind a challenge) without addressing SPA authentication. If any deployment relied on the Blazor page's auth challenge as a gate, deleting it removes that surface while the plan silently assumes "auth is handled elsewhere." GET APIs and `/app` were already unauthenticated in phase (a), so this may be no *new* exposure — but the removal plan should not clear the gate on an unstated assumption. ## Required (recommended) Before Step 2, explicitly confirm the auth posture: enumerate what (if anything) was still behind a Blazor auth challenge, confirm the SPA + API access-control model covers it, and either add an auth step to the plan or record an explicit "no auth regression — GET APIs/SPA already open, verified" sign-off. Don't let the gate clear by omission.
timothy added the priority: mediumreview labels 2026-07-09 21:21:54 +02:00
Author
Owner

Accepted. Known since phase (a) (#91 comment, PR #148 review): OIDC-challenged Blazor pages stopped being the landing surface when / flipped to the open SPA — GET APIs and /app were already unauthenticated, so removal changes exposure only by deleting the last [Authorize]-reachable pages. Removal PR will: (1) verify no auth-gated user-facing capability is lost (enumerate [Authorize]/OIDC-conditional wiring in Startup + Pages), (2) record the resulting posture in docs/decisions.md. Real SPA/API auth design is deliberately deferred to #197 (API security review, already queued as a hard gate before any remote exposure).

Accepted. Known since phase (a) (#91 comment, PR #148 review): OIDC-challenged Blazor pages stopped being the landing surface when `/` flipped to the open SPA — GET APIs and `/app` were already unauthenticated, so removal changes exposure only by deleting the last `[Authorize]`-reachable pages. Removal PR will: (1) verify no auth-gated user-facing capability is lost (enumerate `[Authorize]`/OIDC-conditional wiring in Startup + Pages), (2) record the resulting posture in docs/decisions.md. Real SPA/API auth design is deliberately deferred to #197 (API security review, already queued as a hard gate before any remote exposure).
timothy added this to the Blazor removal (#91 phase b) milestone 2026-07-11 01:14:35 +02:00
timothy added the in-progress label 2026-07-11 16:40:15 +02:00
Author
Owner

Claiming — session started 2026-07-11 (evening). Producing the auth-posture sign-off the removal plan needs: enumerating the actual [Authorize]/OIDC-conditional wiring in Startup.cs + Pages/, confirming no auth-gated capability is lost on Blazor deletion, and recording the resulting posture in docs/decisions.md (+ folding the resolved item into the removal runbook). No production code changes this session — it's the analysis/sign-off that arc item 4's removal PR will cite. Parallel-safe vs the in-flight #202/#204/#253 sessions (docs-only, append-oriented).

Claiming — session started 2026-07-11 (evening). Producing the auth-posture sign-off the removal plan needs: enumerating the actual `[Authorize]`/OIDC-conditional wiring in `Startup.cs` + `Pages/`, confirming no auth-gated capability is lost on Blazor deletion, and recording the resulting posture in `docs/decisions.md` (+ folding the resolved item into the removal runbook). No production code changes this session — it's the analysis/sign-off that arc item 4's removal PR will cite. Parallel-safe vs the in-flight #202/#204/#253 sessions (docs-only, append-oriented).
Author
Owner

Resolved — auth-posture sign-off recorded (PR #261, merged 7608ccce)

What was done. Enumerated the actual authorization wiring in ErsatzTV/Startup.cs + ErsatzTV/Pages (in code, not assumed) and recorded a sign-off in docs/decisions.md, plus folded it into the new removal runbook (docs/blazor-route-parity.md §5) so the gate can't clear by omission.

Findings (verified in code):

  • OIDC (OidcHelper.IsEnabled, config-gated on Authority/ClientId/ClientSecret) attaches auth via AddRazorPages(… AuthorizeFolder("/")) + blazor.UseAuthentication/UseAuthorization (Startup.cs:379-385, 764-770). AuthorizeFolder("/") gates Razor Pages only, whose sole user-facing page is Pages/_Host.cshtml (the Blazor host; Shared/_Favicons.cshtml is a non-routable cosmetic partial). So the OIDC challenge protects exactly the Blazor UI, nothing else.
  • /app (SPA) — own MapWhen(/app) static branch, no auth middleware (Startup.cs:701-714); open since phase (a) (PR #148).
  • /api/* — zero [Authorize] attributes (verified across Controllers/); no FallbackPolicy, so non-attributed endpoints are open. Only optional gate is ApiKeyAuthorizationFilter on mutating endpoints — Blazor-independent.
  • /iptv/* — ConditionalIptvAuthorizeFilter (JWT), own MapWhen branch (Startup.cs:797-803) — Blazor-independent.

Sign-off (the finding's ask). Deleting Blazor removes the OIDC challenge's only attachment point. No capability is lost (every Blazor capability already has an open SPA equivalent) and no NEW exposure is introduced beyond the phase-(a) state — the open SPA already became the default admin surface at phase (a); removal only deletes the now-redundant challenged duplicate. The independent gates (/iptv JWT, API-key filter) survive. Real SPA/API authentication is deferred to #197 (hard gate before remote exposure).

Root cause of the finding. The removal plan (Steps 1–3) listed no auth step, so the gate risked clearing on the unstated assumption "auth handled elsewhere." Now stated explicitly and recorded.

Independent review. A cold, zero-shared-context reviewer independently verified every claim (incl. all cited line numbers) against source — verdict SIGN-OFF SOUND, no counterexample capability found.

Deferred (removal PR's job, per runbook §5 step 2/3): physically deleting the Blazor-attached OIDC pieces (AuthorizeFolder("/"), blazor.UseAuthentication/UseAuthorization) while keeping the OIDC/JWT/API-key service wiring (ripping OIDC out is a #197 call). MapControllers() + /docs co-hosted in the Blazor MapWhen branch must survive the surgical reduction — flagged in the runbook's must-not-break list.

Docs updated (same PR): docs/decisions.md (auth-posture entry), docs/blazor-route-parity.md (§5 runbook).

Closing: the finding is resolved. The physical deletion happens in the gated removal PR, which the runbook now steers.

## Resolved — auth-posture sign-off recorded (PR #261, merged `7608ccce`) **What was done.** Enumerated the actual authorization wiring in `ErsatzTV/Startup.cs` + `ErsatzTV/Pages` (in code, not assumed) and recorded a sign-off in `docs/decisions.md`, plus folded it into the new removal runbook (`docs/blazor-route-parity.md` §5) so the gate can't clear by omission. **Findings (verified in code):** - **OIDC** (`OidcHelper.IsEnabled`, config-gated on Authority/ClientId/ClientSecret) attaches auth via `AddRazorPages(… AuthorizeFolder("/"))` + `blazor.UseAuthentication/UseAuthorization` (Startup.cs:379-385, 764-770). `AuthorizeFolder("/")` gates **Razor Pages only**, whose sole user-facing page is `Pages/_Host.cshtml` (the Blazor host; `Shared/_Favicons.cshtml` is a non-routable cosmetic partial). **So the OIDC challenge protects exactly the Blazor UI, nothing else.** - **`/app` (SPA)** — own `MapWhen(/app)` static branch, no auth middleware (Startup.cs:701-714); open since phase (a) (PR #148). - **`/api/*`** — zero `[Authorize]` attributes (verified across `Controllers/`); no `FallbackPolicy`, so non-attributed endpoints are open. Only optional gate is `ApiKeyAuthorizationFilter` on mutating endpoints — Blazor-independent. - **`/iptv/*`** — `ConditionalIptvAuthorizeFilter` (JWT), own `MapWhen` branch (Startup.cs:797-803) — Blazor-independent. **Sign-off (the finding's ask).** Deleting Blazor removes the OIDC challenge's only attachment point. **No capability is lost** (every Blazor capability already has an open SPA equivalent) and **no NEW exposure** is introduced beyond the phase-(a) state — the open SPA already became the default admin surface at phase (a); removal only deletes the now-redundant *challenged duplicate*. The independent gates (`/iptv` JWT, API-key filter) survive. **Real SPA/API authentication is deferred to #197** (hard gate before remote exposure). **Root cause of the finding.** The removal plan (Steps 1–3) listed no auth step, so the gate risked clearing on the unstated assumption "auth handled elsewhere." Now stated explicitly and recorded. **Independent review.** A cold, zero-shared-context reviewer independently verified every claim (incl. all cited line numbers) against source — verdict SIGN-OFF SOUND, no counterexample capability found. **Deferred (removal PR's job, per runbook §5 step 2/3):** physically deleting the Blazor-attached OIDC pieces (`AuthorizeFolder("/")`, `blazor.UseAuthentication/UseAuthorization`) while **keeping** the OIDC/JWT/API-key service wiring (ripping OIDC out is a #197 call). `MapControllers()` + `/docs` co-hosted in the Blazor `MapWhen` branch must survive the surgical reduction — flagged in the runbook's must-not-break list. **Docs updated (same PR):** `docs/decisions.md` (auth-posture entry), `docs/blazor-route-parity.md` (§5 runbook). Closing: the finding is resolved. The physical deletion happens in the gated removal PR, which the runbook now steers.
timothy removed the in-progress label 2026-07-11 17:21:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#206