From 02317dd36f5d8fddadfd515c90a51e6129a1f02c Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Tue, 25 Aug 2026 21:20:03 +0800 Subject: [PATCH] test(keycloak): fix Keycloak OIDC live fixture (#6563) --- scripts/test/fixtures/keycloak-rustfs-ci-realm.json | 2 ++ scripts/test/oidc_keycloak_live.sh | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/test/fixtures/keycloak-rustfs-ci-realm.json b/scripts/test/fixtures/keycloak-rustfs-ci-realm.json index fd6d567e7..6b7821231 100644 --- a/scripts/test/fixtures/keycloak-rustfs-ci-realm.json +++ b/scripts/test/fixtures/keycloak-rustfs-ci-realm.json @@ -27,6 +27,8 @@ { "id": "00000000-0000-0000-0000-000000000001", "username": "alice", + "firstName": "Alice", + "lastName": "RustFS", "email": "alice@example.test", "emailVerified": true, "enabled": true, diff --git a/scripts/test/oidc_keycloak_live.sh b/scripts/test/oidc_keycloak_live.sh index db2e51197..c464f6dcb 100755 --- a/scripts/test/oidc_keycloak_live.sh +++ b/scripts/test/oidc_keycloak_live.sh @@ -128,14 +128,17 @@ token_for_client() { local client_id="$1" local client_secret="$2" local response_file="${WORK_DIR}/token-${client_id}.json" - curl --noproxy '*' -fsS "${ISSUER}/protocol/openid-connect/token" \ + if ! curl --noproxy '*' -sS --fail-with-body "${ISSUER}/protocol/openid-connect/token" \ --data-urlencode grant_type=password \ --data-urlencode "client_id=${client_id}" \ --data-urlencode "client_secret=${client_secret}" \ --data-urlencode username=alice \ --data-urlencode password=alice-password \ --data-urlencode scope=openid \ - >"${response_file}" + >"${response_file}"; then + cat "${response_file}" >&2 + return 1 + fi python3 - "${response_file}" "${ISSUER}" "${client_id}" <<'PY' import base64 import json