fix(portal): drive eSignet in the portal e2e sign-in - #35
Merged
Conversation
The e2e helper clicked sign-in and asserted /services, which only holds under the mock provider. Against a hosted stack eSignet answers instead, so six of the eight tests failed on the redirect off-origin. The helper now reports which provider answered and completes an eSignet login when that is the one in front: it reissues the authorization while eSignet is still starting, reads the refusals eSignet returns as HTTP 200 rather than trusting the status, and grants claim consent when asked. The persona tests skip the handoff under eSignet, where the subject comes from UserInfo, and assert the inverse there instead. The hosted login smoke drove the same flow from its own copy, so it now imports the helper. Its output stays a fixed line: the helper names the step that failed and never the codes eSignet returned, and the sanitization test follows the code onto the helper. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The portal e2e
signInhelper clicked the sign-in button and asserted/services. That only holds underPORTAL_AUTH_PROVIDER=mock, where the login binds a persona session and continues straight to the catalog. With eSignet in front, the portal redirects off-origin to the eSignet login and the assertion fails on the redirect. Running the suite against a stack with eSignet enabled gave 2 passed / 6 failed, all six on the same first line of the helper.Nothing was wrong with the portal. Only the harness assumed one provider.
What
portal/e2e/support/auth.tsis a new shared helper that discovers the provider from where the sign-in lands (/services= mock,/login= eSignet) and drives whichever answered. The seam is server-side configuration the browser cannot read, so landing path is the only signal available, and using it lets one suite run against a mock build and against a hosted deployment with no new flag.Completing an eSignet login needs three things that are not obvious:
errorsarray.send-otpreturnserrors: []even for an identity eSignet does not hold; the denial only arrives atauthenticate, where the Relay lookup answers. Both responses are read, so a bad demo subject now fails in about two seconds naming the step instead of timing out blind after thirty.The persona tests changed shape: the
?persona=handoff is mock-only by design, since under eSignet the subject comes from UserInfo. Those two tests skip under eSignet. I added a third that asserts the inverse security property, that a query parameter cannot sign anyone in as someone else under eSignet. Say the word if you would rather not have that one.scripts/smoke-esignet-login.mjsdrove the same login from its own copy, so it now imports the helper and is 21 lines. Node strips the helper's types on import; the Playwright import in the helper is type-only, so nothing is resolved at runtime beyond what the smoke already loaded.The smoke's output policy is unchanged and deliberately so. It still prints exactly one fixed line, and the helper names only the step that failed, never the codes eSignet returned.
test_browser_smoke_has_only_fixed_sanitized_outputnow asserts that against the helper, where the code moved, so the guard did not quietly become vacuous. That is why the helper does not surface the error code even though it would be useful in a test report.Two supporting changes: the hosted per-test timeout goes to 120s, since a full OIDC round trip with a boot retry does not fit the 30s default, and
just portal-live-e2ehonoursSOLMARA_PORTAL_PUBLIC_BASE_URLso it can point at a hosted portal instead of only localhost.Verification
pnpm check: 423 files, 0 errors, 0 warningspnpm e2e(mock, built-in webServer): 8 passed, 1 skippedpnpm e2eagainst a hosted stack with eSignet: 7 passed, 2 skippednode scripts/smoke-esignet-login.mjsagainst the same stack: PASSuv run python -m unittest scripts/test_smoke_esignet.py: 5 tests, OKCI does not run either the portal e2e suite or this smoke, so the two live runs above are the coverage.
Flagged, not fixed
The landing page shows "Continuing as " under eSignet too, promising a persona the login will ignore. Cosmetic, in
portal/src/routes/+page.server.ts, and out of scope here.