Repository navigation
[#1221] Add authorize display characterization tests - #1237
Conversation
vharseko
left a comment
There was a problem hiding this comment.
1. [P1] Keep credentials and consent responses out of failure artifacts
The setup now sends the administrator credentials through Playwright’s request fixture, and the tests pass complete consent responses to assertions such as expect(html).toContain(...). With the repository configuration retaining traces on failure and the workflow uploading the Playwright report and test results, a failed run can persist credentials, session information, or the consent page’s CSRF token in logs or artifacts. This also affects runs against a server configured through the OPENAM_* environment variables.
Please restore protection for the authentication and consent data in both API steps and assertion failure output, and verify it with synthetic secret markers in failure artifacts.
2. [P2] Apply the HTTPS setting to the independently created request contexts
apiRequest.newContext() creates an independent API request context and does not inherit use.ignoreHTTPSErrors from the Playwright configuration. Consequently, when OPENAM_BASE_URL points to an HTTPS deployment with a self-signed certificate, the administrator setup can succeed through the configured request fixture, but the resource-owner login fails at this context. The context created by sessionContext and the anonymous context have the same issue.
Please pass the appropriate HTTPS setting to all independently created contexts so this spec works with the same deployments as the configured fixture.
|
@vharseko, replies to the review:
|
vharseko
left a comment
There was a problem hiding this comment.
Thanks for addressing the HTTPS context settings. The failure artifacts contain test secrets, so I withdraw my earlier sanitization request. Approved.
57825f6
into
OpenIdentityPlatform:features/1075-remove-restlet
Part of #1221.
Scope
Add nine authorize-only display characterization tests, adapting
b02024a4f0:e2e/oauth2/display-test.spec.mjsto the current Restlet implementation. They cover page, empty and absent display, popup composition, touch, WML, unknown display, case normalization (including the separate uppercasePOPUPwrapper selection), and authentication before display validation.The spec owns its consent-requiring public client and login session and sends S256 PKCE. Popup checks parse an inert document and require the consent model inside
#print, the container copied into the opened window. The WAP form action must preserve the complete HTML-escaped authorize query, including display and PKCE.The diff is one new spec, 406 additions / 0 deletions. Shared fixtures, existing tests, production code and workflows are unchanged. Device display coverage remains for b3b; the remaining #1221 slices are still outstanding.
Changed expectations from the source
Demo Democn, read through the user API and compared after inert HTML entity decodingformTargetredirect_uriConsentRequiredResourcepreserves the request query in its post-back target. The leading JavaScript slash escape is retained.invalid_requestserver_errorThe anonymous source assertions already pass. They are strengthened to parse the login redirect and check its exact origin/path,
realm=/, and completegoto; the observed status remains 301.Pinned defects
isplayNameand omitsdisplayName, leaving the client heading blank. Target:displayName, as in the page and popup templates.server_error. Target: 400invalid_requestfor an invalid parameter value (RFC 6749 section 4.1.2.1).Validation
Test revision:
66e4097e895e3fc236b9b4047057110c7b69d21f.Server baseline: integration commit
097005086e3113fcd81c382f4aa080ec2f823cf4.Local validation used one OpenAM container with embedded OpenDJ. A temporary reporter suppressed secret-bearing output from existing specs, and traces/screenshots were disabled. The latest spec passed all nine display scenarios after restoring the baseline module; the shared
oauth2 uma xacmlrun then passed 106 tests / 0 failed / 0 skipped. Syntax, discovery (106 tests in eight files, including nine display tests), andgit diff --checkpassed.Four targeted module mutations demonstrate the additional regression coverage. Each mutation was deployed separately; all runs had zero skipped tests:
equalsIgnoreCasetoequalsPOPUPretains the wrapper title and consent modeldisplay=#printThe Java mutations were compiled with
--release 11; the other two changed only templates. Mutations were packaged into temporary OAuth2-module JARs, with deployed SHA256 checked after every restart. The original module was restored and its hash verified before the final green runs. No mutation is committed.The spec-local Node HTTP/HTTPS transport keeps credentials and consent bodies outside Playwright API steps, sanitizes setup/transport/JSON errors, and does not follow redirects. Response-derived HTML, CSRF, model fields and URL comparisons use boolean assertions. The spec disables retained traces/screenshots and decodes the resource-owner name once through an inert textarea.
Earlier validation at
2c2767115c695e0346f1d83fa2eb173c59b5b3c9also checked five deliberate failure probes with the normal list/HTML reporters: authentication transport, provider transport, authorize transport, a consent assertion, and an invalid login Location. Synthetic secret markers were absent from stdout, report files, embedded report ZIP data, and generated failure artifacts after the safety fixes. Four synthetic name cases covered apostrophes, ampersands, named/numeric Unicode entities, and one-pass decoding; a mismatched name still failed. These safety probes were not rerun for the assertion-only follow-up.Server artifact provenance
The baseline WAR came from successful Build run 43852682205, exact baseline SHA,
ubuntu-latest-11artifact 14222035312, distribution-kit server WAR. The assembly copiesopenam-server:warunchanged. The complete nested WAR was extracted from the downloaded archive prefix and its ZIP entry size/CRC checked; the full outer artifact digest was not checked.WAR SHA256:
39599c6caf586b5e31b4971a76548b135eaaa20b9c99ec57e148f55cf0718cde.Baseline OAuth2-module SHA256:
91504f1640eb5a226cccd44993202e25bafba85e5c079bc84ea528d4fef27ce1.The local results above cover
oauth2 uma xacml; the full CI Playwright suite is a separate check. No CI or CodeQL result is claimed here for the latest test revision.