test: codify the three-leg trust chain

This commit is contained in:
donghyeon-ka
2026-07-25 16:40:19 +09:00
parent 1341645cf5
commit 4a55ee71a9
2 changed files with 34 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env sh
set -eu
base="${KEYCLOAK_URL:-http://localhost:8080}"
main_issuer="$base/realms/keycloak-patterns"
mock_issuer="$base/realms/mock-google"
test "$(curl -fsS "$main_issuer/.well-known/openid-configuration" | jq -r .issuer)" \
= "$main_issuer"
test "$(curl -fsS "$mock_issuer/.well-known/openid-configuration" | jq -r .issuer)" \
= "$mock_issuer"
rg -Fq 'SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI:' docker-compose.yml
if rg -qi 'accounts\\.google\\.com|realms/mock-google' backend/src/main; then
echo "backend must trust only the Keycloak issuer, not the upstream IdP" >&2
exit 1
fi
echo "Three-leg trust anchors verified: upstream -> Keycloak -> Resource Server"