Skip to content

Add full-flow behat + playwright coverage for GSSP service name - #95

Open
kayjoosten wants to merge 7 commits into
mainfrom
feature/gssp-service-name-fullflow-behat
Open

Add full-flow behat + playwright coverage for GSSP service name#95
kayjoosten wants to merge 7 commits into
mainfrom
feature/gssp-service-name-fullflow-behat

Conversation

@kayjoosten

@kayjoosten kayjoosten commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds custom stepup/ssp/sp.php (mounted over the stock devssp SP) with mdui:UIInfo/mdui:DisplayName extension support, since the stock SP image doesn't support it
  • Adds behat scenario gssp_service_name.feature: SP → Gateway → GSSP, asserting the service name from the AuthnRequest shows on the GSSP page
  • Adds a playwright suite covering the same flow end to end against the running devconf stack
  • Tagged @SKIP until Stepup-Gateway#624 merges and releases in the test image

How to test locally against the in-flight feature branches

./start-dev-env.sh gateway:<Stepup-Gateway checkout on feature/issue-591-service-name-saml-extension> demogssp:<Stepup-gssp-example checkout>
docker compose exec behat ./vendor/bin/behat --config config/behat.yml features/gssp_service_name.feature

Or run the playwright suite in stepup/tests/playwright/ (see its README).

Note: this exercises Gateway → GSSP directly via the SSP test SP, not the full production path through EngineBlock (EngineBlock#2034 handles that leg separately).

…mdui:UIInfo

Adds a behat feature that exercises the cross-repo service name flow:
the SP includes an mdui:UIInfo/mdui:DisplayName extension in the SFO
AuthnRequest, the Stepup-Gateway (with feature flag
enable_service_name_from_saml_authnrequest enabled) forwards it in the
proxy AuthnRequest to the GSSP, and the demo GSSP displays the service
name on its authentication page.

The devssp test SP does not support the mdui:UIInfo extension yet, so a
patched sp.php with an mdui_displayname form field is mounted over the
one in the devssp container, pending upstream inclusion in
OpenConext-devssp.
Playwright suite exercises the mdui:UIInfo service-name flow end to end
against the running devconf stack, complementing the existing behat
scenario. Also adds a missing "on the GSSP registration page" assertion
step alongside the existing authentication-page one.
mdui_displayname support is now a real patch against
OpenConext-devssp's sp.php instead of a full-file mount, so the
711-line local copy and its docker-compose override are no longer
needed here. Not pushed yet: this depends on the devssp image being
rebuilt with that patch, so the test/behat run against the current
:latest image will not have the mdui field until then.
# ./start-dev-env.sh gateway:<Stepup-Gateway checkout> demogssp:<Stepup-gssp-example checkout>
# docker compose exec behat ./vendor/bin/behat --config config/behat.yml features/gssp_service_name.feature
@SKIP
Feature: The GSSP shows the name of the service the user is authenticating for

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What i expect to see here: All 3 of the LoginService::singleSignOn methods should be triggered from here to see if the gateway applies (or discards????) the mdui information.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stepup/tests/behat/features/sfo.feature stepup/tests/behat/features/sfo_gssp_fallback.feature

Gateway has three independent LoginService::singleSignOn implementations that
each read the mdui:UIInfo extension behind the same feature flag:
GatewayBundle (plain SSO), SecondFactorOnlyBundle, and SamlStepupProviderBundle
(the latter two already exercised by the existing SFO scenarios). Per
review feedback on this PR, add a third scenario that drives the plain SSO
flow (second-sp -> default-sp) so a regression in that specific copy would
be caught even with the SFO scenarios passing.

Also fixes lib/middleware.ts's pushServiceName(), which was sending
service_name as a bare string. Middleware/Gateway expect a locale => name
map (SamlEntity::fromConfiguration coerces anything that isn't an array to
[]), so the value was silently discarded rather than actually overriding
the AuthnRequest's mdui:DisplayName.

Adds seed-test-identity.sh: seeds a fully vetted Demo GSSP identity directly
via Middleware's command API (the same mechanism FeatureContext's "has a
vetted" step uses), so testing this flow manually no longer requires the
registration UI, RA app, or any second-factor hardware.
VerifyYubikeyOtpType's field is named yubikeyInput with block prefix
gateway_verify_yubikey (see Stepup-Gateway's Form/Type/VerifyYubikeyOtpType.php),
not the gateway_verify_yubikey_otp_otp / gateway_verify_yubikey_otp_submit ids
these helpers were still using. Every scenario that verifies a Yubikey second
factor or logs into the RA app was failing on
"Form field ... gateway_verify_yubikey_otp_otp not found" as a result.
- The feature flag is append_service_name_to_authnrequest, not
  enable_service_name_from_saml_authnrequest (that name never existed in
  Stepup-Gateway's config; only the FeatureConfiguration method uses that
  wording).
- OpenConext-devssp's mdui_displayname field merged upstream, so it's no
  longer a pending dependency for lifting @Skip -- only Gateway#624 is.
- The documented `./vendor/bin/behat --config config/behat.yml
  features/gssp_service_name.feature` invocation doesn't actually work: the
  suite's default tag filter excludes @Skip, so it reports "No
  specifications found" unless --tags='~@wip' is passed to override it.
- append_service_name_to_authnrequest defaults to false and devconf has no
  parameters override enabling it, so "already the case in the devconf
  parameters" was incorrect -- documented the manual step needed instead.
- Documented seed-test-identity.sh as an alternative to the Behat-bootstrap
  dependency in the Playwright README.
Not meant to be pushed to GitHub -- the Behat coverage (gssp_service_name.feature)
is the test suite of record for this feature. Local node_modules/test-results/
screenshots were already gitignored and never tracked.
@kayjoosten
kayjoosten force-pushed the feature/gssp-service-name-fullflow-behat branch from 9781c80 to d86182b Compare August 3, 2026 13:06
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.

2 participants