Skip to content

test(ui): exercise the conformance self-fetch under every auth mode - #445

Open
angela-helios wants to merge 1 commit into
mainfrom
feat/320-auth-e2e
Open

test(ui): exercise the conformance self-fetch under every auth mode#445
angela-helios wants to merge 1 commit into
mainfrom
feat/320-auth-e2e

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Closes #320

The UI self-fetches GET /SearchParameter and GET /CompartmentDefinition over HTTP, and that call must honor whatever auth mode the server runs in — no carve-outs. The browser suite now proves it:

Two new e2e legs (Playwright projects auth and auth-degraded, each with its own server): boot.mjs grows a HFS_E2E_AUTH mode that stands up the entire IdP surface the server needs with zero external dependencies — a throwaway RSA keypair served as a JWKS from a local HTTP server, and RS256 tokens minted in-process. Databases are per-port now, so the three servers coexist.

  • authHFS_AUTH_ENABLED=true + a minted HFS_OUTBOUND_BEARER_TOKEN carrying system/SearchParameter.rs system/CompartmentDefinition.rs (and deliberately no tenant claim: the claim is authoritative when present, and the self-fetch scopes each call with X-Tenant-ID). The conformance pages render real registry data, and a control test pins that an anonymous API call is still 401 — the pages work because the self-call authenticates, not because auth grew a loophole.
  • auth-degraded — auth on, no outbound token. The pages degrade to their warning state; the failed fetch is served degraded for that request only and re-attempted on the next.

One UI fix the legs flushed out: the compartments page answered an empty definitions fetch with a 404; it now renders the shell with a warning (three locales), like the SearchParameter page always did. Covered by a router test too.

Book: new chapter Web UI Self-Calls and Authentication — the supported modes (off / static bearer / IdP-issued), the no-tenant-claim guidance, the degraded/heal-without-restart behavior, and the planned JwtAssertionOutboundAuthProvider follow-up from crates/hfs/src/main.rs.

Scope note: the issue's Keycloak smoke moved to its own issue (#444 — it needs a sibling container on the remote Docker daemon, so it belongs in a manual/nightly job, not per-PR).

Screenshots — degraded state (auth on, no outbound token)

search parameters degraded

compartments degraded

Tests

6 new e2e (2×3), one new router test; full local suite 104 passed including both new legs; router_http 33/33.

Two e2e legs join the browser suite (#320): auth enabled with a
provisioned outbound service token — the conformance pages render real
registry data through the authenticated self-call, while anonymous API
calls stay 401 — and auth enabled without one, where the pages degrade to
their warning state and the failed fetch is retried, not cached. boot.mjs
grows the whole IdP surface the server needs: a throwaway RSA key served
as a JWKS from a local HTTP server, and locally-minted RS256 tokens with
the two conformance read scopes. The service token carries no tenant
claim on purpose — the claim is authoritative when present, and the
self-fetch scopes each call with X-Tenant-ID.

The compartments page previously answered an empty definitions fetch with
a 404; it now renders the shell with a warning like the SearchParameter
page, in the three locales.

The book documents the supported modes (off / static bearer / IdP-issued)
and the planned JwtAssertionOutboundAuthProvider follow-up.

Closes #320
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

test(ui): exercise the conformance self-fetch and the UI under every auth mode

2 participants