test: codify SPA PKCE flow stages

This commit is contained in:
donghyeon-ka
2026-07-25 16:36:43 +09:00
parent 2765f5d109
commit 55a99b8147
2 changed files with 36 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -eu
npm --prefix frontend ci
npm --prefix frontend test
jq -e '
.clients[]
| select(.clientId == "spa-public")
| .publicClient == true
and .standardFlowEnabled == true
and .implicitFlowEnabled == false
and .directAccessGrantsEnabled == false
and .attributes["pkce.code.challenge.method"] == "S256"
' keycloak/import/keycloak-patterns-realm.json >/dev/null
rg -q 'response_type: "code"' frontend/src/app.js
rg -q 'new InMemoryWebStorage' frontend/src/app.js
rg -Fq 'cryptoApi.subtle.digest(' frontend/src/pkce.js
rg -Fq '"SHA-256"' frontend/src/pkce.js
echo "PKCE stages verified: verifier -> S256 challenge -> code -> verifier exchange"