Authenticate the integration tests against a local Keycloak realm - #87
Authenticate the integration tests against a local Keycloak realm#87oysand wants to merge 3 commits into
Conversation
Full suite verified — ready for reviewBuilt all three service images from the local branches ( (Note: the description on #83 said 12 tests. The suite collects 4 — that number was wrong.) The Flotilla → ISAR hop is now provenThis was the one thing nothing else could verify. Straight from the run: followed by 9 Everything else that ran
CostKeycloak reports One fix from the runThe realm import logged Taking this out of draft. |
The suite authenticated against Azure Entra ID using four app registrations whose client secrets came from
FlotillaTestsKv. That meant every contributor neededaz loginand access to a shared vault, four secrets to rotate, and a suite that could not run outside Equinor's tenant.It now runs a Keycloak container and mints tokens from it.
custom_realms/robotics-realm.jsonis a fixture — its client secrets are not secret — and is the same file flotilla and sara mount to run against Keycloak locally, so a developer's stack and CI exercise the same clients, scopes and roles.az loginneeded locallyMQTT still needs the vault: the broker validates credentials against a hashed
passwd_filecommitted in equinor/flotilla, which is out of scope here.INTEGRATION_TEST_AZURE_CLIENT_SECRETis made optional, not removed — every one of the 17 repos declares it and consumes this workflow at@main.Also adds the property nothing previously covered: whether authentication is switched on at all. The fixtures assert each service rejects unauthenticated callers before yielding, and two existing mission tests attempt unauthorised interference mid-flight, with the surrounding status assertions proving it had no effect.
Verified locally with all three service images built from the corresponding branches via
scripts/build_local_images.sh, noaz login, and only the four MQTT secrets in.env: 4 passed in 4m30s underpytest -s -n auto. 15 fixture auth invariants fired, both woven negative scenarios passed, and there was zero contact withlogin.microsoftonline.com. Note that this suite does not run in armada's own PR CI, so that local run is the evidence.Merge order: equinor/isar#1158 → isar-robot bump → equinor/flotilla#2863 + equinor/sara#456 → wait for published images → this PR.
Supersedes #83, which stays open as a fallback until this set is approved.