ci(stepup-behat): generate HAProxy dev certificate before compose up - #98
ci(stepup-behat): generate HAProxy dev certificate before compose up#98kayjoosten wants to merge 5 commits into
Conversation
Commit 2291d6f stopped committing core/haproxy/haproxy.pem and moved its generation into core/scripts/create_dev_ca.sh, invoked only by start-dev-env.sh. The stepup-behat workflow runs 'docker compose up' directly, so haproxy.pem was missing; Docker created it as a directory and the haproxy container failed to start, taking down TLS routing and every Behat scenario with it. Run create_dev_ca.sh in the Init step, matching start-dev-env.sh's guard.
|
CI on this branch now gets 155 Behat scenarios running (53 passing) where |
Since the CA became dynamically generated (2291d6f) the app containers no longer trust the HAProxy TLS certificate: the static stepup/haproxy/haproxy.crt that used to be committed is gone, and only start-dev-env.sh copies the freshly generated one into place. CI skipped that copy, so every inter-service HTTPS call failed with 'cURL error 60: self signed certificate in certificate chain', cascading into ~100 Behat failures. Copy core/haproxy/haproxy.crt to stepup/haproxy/haproxy.crt before compose up; the base image imports /config/haproxy/haproxy.crt and runs update-ca-certificates on startup.
|
Follow-up on the remaining stepup-behat failures: What I fixed on this branch:
Result:
What remains unexplained:
Root-cause hypothesis for the YubiKey failures:
I opened follow-up issue #99 to track that separate investigation. |
|
Root cause of the remaining 88 Fixed upstream in OpenConext/Stepup-Gateway#666 (trigger on push to Re-ran this PR's Behat suite against the refreshed image: 155/155 scenarios passing. ✅ |
Mount a selfservice parameters override so logout redirects stay inside the dev/CI environment instead of following the baked-in www.surf.nl URLs. Update the Behat expectation to assert the local test SP target.
2d3ddb0 to
4faa694
Compare
The previous commit assumed the docker-compose bind mount of the full stepup/selfservice/parameters.yaml onto the container's config was a bug that clobbered the image's baked-in configuration, and replaced it with a partial merge against that baked-in config via an entrypoint script. That assumption was wrong. The full local parameters.yaml is the intentional, correct pattern already used for this dev/behat environment: it supplies the gateway, middleware and SAML values this environment actually needs (dev URLs, dev SAML certificates and credentials), which are not present in the image's baked-in config at all. Replacing it with a partial merge dropped all of those values and broke the SAML login redirect, which is why the Behat suite started failing (22 scenarios) right after that change. This reverts back to mounting the full local parameters.yaml, which is the state the Behat suite was passing against before.
Problem
stepup-behatCI (and Stepup-Gateway'stest-integration, which brings thestack up the same way) fails when the HAProxy development certificate has not
been generated before
docker compose up.The SelfService logout flow used by the Behat scenarios also needs to stay
inside the local Stepup stack. The upstream SelfService image redirects logout
to the public SURF pages by default, while the test flow continues through the
local test SP.
Cause
Commit 2291d6f (2026-08-12) stopped committing
core/haproxy/haproxy.pemandmoved its generation into
core/scripts/create_dev_ca.sh, which is onlyinvoked by
start-dev-env.sh. CI runsdocker compose updirectly, so thefile is missing unless CI generates it first.
The SelfService image ships with a default
parameters.yamlaimed at thepublic SURF environment (public gateway/middleware URLs, public logout
redirect, etc.), which doesn't work for this local dev/behat stack.
Fix
Run
create_dev_ca.shin the Init step beforecompose upand copy the dev CAcertificate into the Stepup stack so the app containers trust HAProxy TLS.
For SelfService, bind-mount a complete local
parameters.yamlover theimage's default config, matching the pattern already used by the other
services in this stack. It points the app at the local gateway/middleware/SAML
setup and keeps the logout redirect on the local test SP domain instead of the
public SURF one.
The Behat logout assertion is updated to expect the local test SP domain.
Supersedes #97 (which chased a wrong
--remote-allow-originslead).