22 lines
570 B
Bash
Executable File
22 lines
570 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
corpus=/etc/thothii/backend-url-cases.json
|
|
|
|
jq -c '.[]' "$corpus" | while IFS= read -r case_json; do
|
|
value=$(printf '%s' "$case_json" | jq -r '.value')
|
|
valid=$(printf '%s' "$case_json" | jq -r '.valid')
|
|
if BACKEND_BASE_URL="$value" /usr/local/bin/frontend-entrypoint true \
|
|
>/dev/null 2>&1; then
|
|
actual=true
|
|
else
|
|
actual=false
|
|
fi
|
|
if [ "$actual" != "$valid" ]; then
|
|
echo "entrypoint policy mismatch for BACKEND_BASE_URL=$value: expected $valid" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo "frontend entrypoint canonical URL corpus: ok"
|