Move browser authentication behind a generated-contract BFF

This commit is contained in:
ms2k 2026-07-19 18:21:17 +09:00
commit fa7220ee33

View file

@ -30,14 +30,33 @@ spec:
args:
- |
retry="--retry 30 --retry-all-errors --retry-delay 1"
test "$(curl $retry --silent --output /dev/null --write-out '%{http_code}' http://remora-remora-api-metrics:9090/health/ready)" = 200
test "$(curl $retry --silent --output /dev/null --write-out '%{http_code}' http://remora-remora-web/health/ready)" = 200
curl $retry --fail --silent http://remora-remora-api-metrics:9090/metrics | grep -q remora_background_runs_total
curl $retry --fail --silent http://remora-remora-web/runtime-config.js | grep -q '"oidcClientId":"remora-web"'
test "$(curl $retry --silent --output /dev/null --write-out '%{http_code}' http://remora-remora/v1/jobs)" = 401
expect_status() {
name="$1"
expected="$2"
shift 2
actual="$(curl $retry --silent --output /dev/null --write-out '%{http_code}' "$@")"
if test "$actual" != "$expected"; then
printf '%s returned HTTP %s, expected %s\n' "$name" "$actual" "$expected" >&2
return 1
fi
}
expect_body() {
name="$1"
pattern="$2"
shift 2
if ! curl $retry --fail --silent "$@" | grep -q "$pattern"; then
printf '%s did not contain the expected response marker\n' "$name" >&2
return 1
fi
}
expect_status "API readiness" 200 http://remora-remora-api-metrics:9090/health/ready
expect_status "Web readiness" 200 http://remora-remora-web/health/ready
expect_body "API metrics" remora_background_runs_total http://remora-remora-api-metrics:9090/metrics
expect_body "Web runtime configuration" '"apiUrl":"/bff/api/"' http://remora-remora-web/runtime-config.js
expect_status "API authentication" 401 http://remora-remora/v1/jobs
if test -n "@@INGRESS_URL@@"; then
curl $retry --fail --silent --header 'Host: qualification-ingress' @@INGRESS_URL@@/ | grep -q '<title>Remora</title>'
test "$(curl $retry --silent --header 'Host: qualification-ingress' --output /dev/null --write-out '%{http_code}' @@INGRESS_URL@@/v1/jobs)" = 401
expect_body "Ingress WebClient" '<title>Remora</title>' --header 'Host: qualification-ingress' --header 'Accept: text/html' @@INGRESS_URL@@/
expect_status "Ingress API authentication" 401 --header 'Host: qualification-ingress' @@INGRESS_URL@@/v1/jobs
fi
if curl --connect-timeout 2 --max-time 5 --insecure --silent --fail https://remora-remora-worker:8443/internal/v1/jobs/x/claim >/dev/null 2>&1; then
exit 1