ci: supply Keycloak config to api-smoke and preflight it - #18
Merged
Conversation
Same change as on the test branch, applied to CI because that is the ref the callers use (run-smoke.yml@CI). CI is dev plus 46 lines - the api_base_url / deployed_sha / min_passed inputs exist only here - so the patch is applied directly rather than merged, and those inputs are left untouched. The workflow passed no Keycloak variables at all, so keycloak_config skipped and every authenticated API test skipped with it, while the summary still read 0 failed. Host, realm and client id are public and become repo variables with literal defaults. `dataspace` is a confidential client (ROPC returns 401 unauthorized_client without a secret), so KEYCLOAK_CLIENT_SECRET is a real secret. The preflight fails the job when any of the four is missing and checks OIDC discovery before any test runs. The issuer is compared against EXPECTED_ISSUER, pinned independently rather than derived from KEYCLOAK_URL - deriving it is vacuous, since the decommissioned server reports its own /auth issuer quite happily.
This was referenced Sep 2, 2026
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.
Merge this before the caller PRs, and only after
KEYCLOAK_CLIENT_SECRETexists as a repository secret.The problem
run-smoke.ymlpassed no Keycloak variables at all. Sokeycloak_configskipped, every authenticated API test skipped with it, and the run summary still read0 failed.A green
api-smoketherefore did not mean the authenticated paths worked — it meant they had not been attempted. That is how a staleKEYCLOAK_URLpointing at the decommissionedopub-kcserver survived the migration without anything going red.The change
Host, realm and client id are public, so they become repo variables with literal defaults — correct out of the box, visible in review, overridable without a code change.
dataspaceis a confidential client (ROPC returns401 unauthorized_clientwithout a secret), soKEYCLOAK_CLIENT_SECRETis a real secret.A preflight step now fails the job when any of the four is missing, and checks OIDC discovery before any test runs.
Why the issuer is pinned separately
EXPECTED_ISSUERis declared independently rather than derived fromKEYCLOAK_URL.Deriving it is vacuous. The decommissioned server reports its own
/authissuer perfectly consistently, so comparing an issuer against the host it came from passes for any running Keycloak and proves nothing about which one it is. I wrote that version first and tested it withKEYCLOAK_URLstill set toopub-kc— it passed. Same failure class as the bug this is meant to catch.Why this targets
CI, notdevCallers reference
run-smoke.yml@CI, soCIis the only ref that takes effect.CIis alsodev+46 lines — theapi_base_url/deployed_sha/min_passedinputs exist only here — so the patch is applied directly rather than merged, leaving those inputs untouched.The same commit also rides along on
test/keycloak-migration-and-new-features(againstdev) so a laterdev→CImerge does not silently revert it. Expect a conflict in that hunk; either side is fine.Preflight behaviour, all four paths tested
/authURLBlast radius
KEYCLOAK_CLIENT_SECRETis declared optional inworkflow_callso the three existing callers keep parsing. Butapi-smokefails its preflight until each caller passes it and the secret is set.DataSpaceFrontendgatespromote-devon smoke passing, so dev promotion will block until then.Ordering: add the secret everywhere → merge this → merge the two caller PRs.