试验 React 内联上下文与原生表单登录流程

This commit is contained in:
2026-09-25 19:44:39 +00:00
parent 8c8b2ad352
commit dcf634d805
23 changed files with 2253 additions and 22 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
repo_root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
cache_dir=${IAM_NPM_CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/iam-login/npm}
mkdir -p -- "$cache_dir"
cache_dir=$(cd -- "$cache_dir" && pwd)
docker_cmd=(docker)
if [[ ${IAM_DOCKER_USE_SUDO:-0} == 1 ]]; then
docker_cmd=(sudo -n docker)
fi
exec "${docker_cmd[@]}" run --rm --network host \
--cpus 2 --memory 1g --user "$(id -u):$(id -g)" \
-e HOME=/npm -e npm_config_cache=/npm \
-v "$cache_dir:/npm" -v "$repo_root:/workspace" \
-w /workspace/frontend node@sha256:d8e448a56fc63242f70026718378bd4b00f8c82e78d20eefb199224a4d8e33d8 \
sh -c 'npm ci --no-audit --no-fund && npm run build'
+2
View File
@@ -13,6 +13,8 @@ if (($# == 0)); then
set -- test
fi
"$repo_root/scripts/frontend-in-docker"
# Linux host networking is needed for Testcontainers' published ports.
exec "${docker_cmd[@]}" run --rm --network host \
--cpus "${IAM_BUILD_CPUS:-4}" --memory "${IAM_BUILD_MEMORY:-8g}" \
+1
View File
@@ -78,6 +78,7 @@ def main():
ready_seconds = time.monotonic() - started
assert request('/actuator/prometheus')[0] == 401, 'Anonymous metrics must be rejected'
assert request('/')[0] == 401, 'Anonymous application access must be rejected'
assert request('/preview')[0] == 404, 'UI preview must be disabled by default'
status, before = request('/actuator/prometheus', authenticated=True)
assert status == 200, 'Authenticated Prometheus scrape failed'
for _ in range(3):