Repository navigation
[#1221] Add device display characterization tests - #1238
maximthomas wants to merge 2 commits into
Conversation
vharseko
left a comment
There was a problem hiding this comment.
[P2] Check the device consent model inside the popup container
e2e/oauth2/display-test.spec.mjs:408
The popup assertions search the entire response, but popup.ftl copies only #print into the opened window. A device-specific rendering regression that leaves the consent model outside that container therefore passes every check here while the popup opens without the consent form and cannot submit the user code. The existing /authorize test checks the container, but it cannot detect a regression limited to the device response. Please parse the device popup's #print content and check that it contains the consent model, including the matching user code and form target.
|
@vharseko, addressing this review. Updated in A focused FreeMarker/Chromium probe passes the normal templates and rejects nine container mutations; the previous assertions accepted all nine. Live OpenAM e2e validation has not been rerun because Docker Desktop was unavailable during local validation. |
vharseko
left a comment
There was a problem hiding this comment.
The device popup assertions now inspect the consent model inside #print, including the matching user code and form target. This addresses my previous finding. I found no further issues in the fix.
I verified the parsing behavior with a focused Chromium probe. I did not rerun the live OpenAM e2e suite; the PR checks are still running.
Part of #1221.
Add the three device display scenarios from
b02024a4f0:e2e/oauth2/display-test.spec.mjson top of merged b3a (#1237). The incremental diff is 141 additions / 1 deletion (142 changed lines) and touches onlye2e/oauth2/display-test.spec.mjs: a separate consent-requiring device client, two helpers, and three tests. All nine merged authorize tests remain unchanged, giving twelve display tests in total. Production code, shared fixtures, workflows and existing device-PKCE coverage are unchanged.The consent scenario retains all four display variants (
page,popup,touch,wap). For the three XUI templates it verifies the client identity, response type, scope, nonempty CSRF, user code and form target. For WAP it verifies the corresponding existing hidden submission fields and form action. The code-entry scenario checks all five display values, includingbogus, and compares the complete HTML after masking only freshly generated CSRF values.Changed expectations from the source
user_codeand display in the query, expecting 200pageData.userCodeinvalid_request, exact enum descriptionserver_error; error-page title and error code retained, description omittedPinned defects
isplayNameand omitsdisplayName. Target:displayName.server_error. Target: 400invalid_request.user_code, so its next consent submission loses the code. Target: a hiddenuser_codebody field. This characterization explicitly requires the current absence; it does not fix the template.Validation
Test commit:
e7f0c535e1f4d1969151a0d2aba77960e070c760.Integration base:
57825f6732dd04bdd4ae6aafabb2d0a31cd7539b.Server WAR source:
097005086e3113fcd81c382f4aa080ec2f823cf4, successful Build run 43852682205,ubuntu-latest-11artifact 14222035312. Only e2e files differ between that source and the integration base, establishing production-source equivalence. The complete nested server WAR was verified against its archive entry size and CRC; the full outer archive digest was not checked.WAR SHA256:
39599c6caf586b5e31b4971a76548b135eaaa20b9c99ec57e148f55cf0718cde.Local validation uses one OpenAM container with embedded OpenDJ. The temporary runner emits login success labels without token bytes; traces and screenshots are disabled and a local reporter suppresses existing secret-bearing diagnostics. New secret/HTML assertions compare booleans and retain useful labels. Five deliberately failing matchers using the actual added assertion lines confirmed that user-code, CSRF and complete-HTML sentinels are absent from captured assertion errors.
Source-contract recording with diagnostic-only sanitization preserved all three source requests, payloads and expected contract values. Both runs executed all three scenarios: 0 passed / 3 failed / 0 skipped. The first failures were consent GET expecting 200 but receiving 303, unknown-display GET expecting 400 but receiving 303, and unmasked entry-page equality expecting true but receiving false after five 200 responses. Raw HTML matchers and secret-bearing logs/errors were sanitized without masking contract differences.
oauth2 uma xacml, each of two runs on one fresh standThe ignore-display mutant fails the five existing authorize checks for popup, touch, WAP, unknown display and case normalization. Device consent passes its page leg then fails popup's lowercase-doctype predicate; unknown device display fails expected 400 versus received 200. Entry rendering remains green. The missing-CSRF mutant returns 200 consent HTML but fails the exact CSRF-presence boolean; all authorize, unknown-display and entry scenarios stay green. Deployed module hashes were verified against each mutant WAR.
The entry-template mutant routes only popup through a separate code-entry template, preserving the default entry page. All five responses retain their expected status and shell markers; the CSRF-masked HTML equality fails. Only the entry scenario is red. This mutates the product routing/template selection rather than inverting a test assertion.
After restoring the original WAR,
oauth2 uma xacmlran twice on one fresh embedded stand: 132 passed / 0 failed / 0 skipped in each run, including all twelve display tests and all existing device-PKCE tests. The restored deployed OAuth2 module hash matches the original WAR. Discovery confirms 132 tests in nine files, superseding the plan's older counts.node --check, test discovery,git diff --check, incremental changed-line budget and independent code review passed. No review findings remain. All nine authorize tests are unchanged. No temporary specs or production mutations are present in the repository.The remaining b4/b5 ports and #1221's formal master acceptance condition remain outstanding. This PR completes the device slice of b3; it does not close #1221. PR-specific Build/build-docker validation is pending; no CodeQL result is claimed for this integration base.