fix: skip keycloak hook when profile inactive and update stale PRM test

Add DNS pre-check (getent hosts keycloak) to the post-installation hook
so it exits instantly when the keycloak profile is not active, instead of
retrying for ~2.5 minutes. Also update test_prm_endpoint to assert the
AS proxy URL (localhost:8001) per ADR-023, replacing the stale Nextcloud
URL (localhost:8080).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-03-02 15:50:15 +01:00
parent 5947fff13f
commit e7157ab256
2 changed files with 9 additions and 1 deletions
@@ -13,6 +13,14 @@ echo "===================================================================="
echo "Configuring user_oidc provider for Keycloak..."
echo "===================================================================="
# Quick check: Is keycloak service in the Docker network?
# When the keycloak profile is not active, this hostname won't resolve.
if ! getent hosts keycloak >/dev/null 2>&1; then
echo " Keycloak service not detected in Docker network (profile not active)"
echo " Skipping keycloak provider configuration"
exit 0
fi
# Wait for Keycloak to be ready and realm to be available
echo "Waiting for Keycloak realm to be available..."
MAX_RETRIES=30
@@ -33,7 +33,7 @@ async def test_prm_endpoint():
assert prm_data["resource"] == "http://localhost:8001/mcp"
assert "notes:read" in prm_data["scopes_supported"]
assert "notes:write" in prm_data["scopes_supported"]
assert "http://localhost:8080" in prm_data["authorization_servers"]
assert "http://localhost:8001" in prm_data["authorization_servers"]
assert "header" in prm_data["bearer_methods_supported"]
assert "RS256" in prm_data["resource_signing_alg_values_supported"]