fix(mock-idp): provision the test user so Workbench SSO can resolve it - #601
Merged
Conversation
Keycloak authenticates the realm's test user, but rserver still has to map the returned username to a local Unix account, and no Workbench container in the mock-IdP stack ever had one. Every run timed out on Workbench auth and skipped its tests, which reported green because pytest exits 0 on skips alone. startup.sh is the only thing that creates the account, and it is mounted just for compose.yml's password-auth stack. These images override ENTRYPOINT and run bare supervisord, so a cont-init.d mount would not fire regardless. Call the same script from the entrypoint instead, keeping one source of truth for the useradd logic and the VIP_TEST_USERNAME/VIP_TEST_PASSWORD contract. Also corrects docker/connect/Dockerfile.oidc's claim that Workbench uses s6-overlay. Closes #600
The stock Workbench image already ships /usr/local/bin/startup.sh, and its supervisord "rstudio-workbench" program runs it to create the rstudio user and exec rserver. Copying VIP's startup.sh over that path meant supervisord ran the user-creation script instead, which exits 0, so rserver never started and the container died after three retries.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the mock-IdP E2E Workbench OIDC lane by ensuring the realm’s test user (vip_test) exists as a local Unix account inside the Workbench container, so rserver can resolve the SSO-authenticated username to an OS user (instead of timing out and skipping all Workbench tests).
Changes:
- Call the existing Workbench user-provisioning logic during OIDC container startup (
entrypoint-oidc.sh) and hard-fail if the user still doesn’t exist. - Install the provisioning script under a non-conflicting name (
vip-create-test-user.sh) in the Workbench OIDC image. - Document and wire
VIP_TEST_USERNAME/VIP_TEST_PASSWORDinto the mock-idp compose stack; update Connect OIDC Dockerfile commentary for correctness.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| docker/workbench/entrypoint-oidc.sh | Provisions the realm test user as a local Unix account before starting supervisord/rserver. |
| docker/workbench/Dockerfile.oidc | Copies startup.sh into the image as vip-create-test-user.sh to avoid clobbering the base image’s startup.sh. |
| docker/connect/Dockerfile.oidc | Updates comments to reflect that Workbench does not use s6-overlay/cont-init.d in this stack. |
| compose.mock-idp.yml | Documents the OS-user requirement and passes VIP_TEST_USERNAME / VIP_TEST_PASSWORD into the Workbench service. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 18, 2026
Closed
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ian-flores
marked this pull request as ready for review
August 18, 2026 19:01
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.
Closes #600
What
Provisions the mock-IdP realm's test user as a local Unix account in the Workbench container, from
entrypoint-oidc.sh.Why
Workbench SSO never completed in this stack. Keycloak authenticates the realm user fine, but
rserverstill has to map the returned username to an OS account, and no Workbench container here ever had one — so it refused the sign-in and the pre-test auth round-trip timed out on every leg of every run, including onmain(32103933643).docker/workbench/startup.shis the only thing that creates the account, and it is mounted solely forcompose.yml's password-auth stack. These images overrideENTRYPOINTand run baresupervisord, so acont-init.dmount would not fire on them regardless. Calling the same script from the entrypoint keeps one source of truth for theuseraddlogic and theVIP_TEST_USERNAME/VIP_TEST_PASSWORDcontract.Verified
Run 32172732884 on this branch, all three Workbench legs:
>>> Workbench authenticated.Warning: Workbench authentication did not completeLocal checks cannot reach this:
bash -n,docker compose config -qand the selftests (1620 pass) do not see inside the image, which is where the risk lives. The first dispatch (32169996431) proved that — it created the user but installed the script over the image's own/usr/local/bin/startup.sh, which its supervisordrstudio-workbenchprogram runs to create therstudiouser and execrserver, sorserverwentFATALand the container exited. The script is therefore installed asvip-create-test-user.sh; do not rename it tostartup.sh.What this does not fix
test_workbench_loginstill skips, and this PR does not change that. It skips for an unrelated, by-design reason —src/vip_tests/workbench/test_auth.py:90skips whenever the provider is notpassword— so the reason is identical before and after this change. Tracked in #602. The Workbench half ofmock-idp-e2etherefore still verifies no login, even though SSO now works.Notes
useradd -mcan exit non-zero when the home directory already exists, which happens on a container recreate against a warm/homevolume —/etc/passwdlives in the image layer, so the script's ownidcheck misses. The entrypoint tolerates that exit code and then asserts the user exists, so a genuine provisioning failure stops the container rather than resurfacing later as an unexplained sign-in rejection.Also corrects
docker/connect/Dockerfile.oidc's claim that Workbench uses s6-overlay; container logs show bare supervisord.Related
#596 —
vip verifyexits 0 when a configured product's tests all skip, which is what kept this invisible. #595 carries the same provisioning fix for the SAML lane and will need a small rebase incompose.mock-idp.ymlonce this merges.