verify-boundaries.sh (1172B)
1 #!/usr/bin/env bash 2 set -euo pipefail 3 4 repo_root="$(git rev-parse --show-toplevel)" 5 cd "$repo_root" 6 7 cargo run --locked --offline -p radrootsd_xtask -- source-lock check 8 cargo test --locked --offline --test source_lock 9 10 for forbidden_root in docs .github .act; do 11 test ! -e "$forbidden_root" 12 test ! -L "$forbidden_root" 13 done 14 test "$(cargo public-api --version)" = "cargo-public-api 0.52.0" 15 temporary_api="$(mktemp)" 16 trap 'rm -f "$temporary_api"' EXIT 17 cargo +nightly-2026-07-16 public-api --all-features -sss -p radrootsd >"$temporary_api" 18 cmp "$temporary_api" contracts/api_baselines/radrootsd.txt 19 20 if git ls-files | grep -E -i '(^|/)(\.env|id_rsa|id_ed25519|credentials|[^/]+\.(pem|key|p12|pfx|jks|keystore))$' >/dev/null; then 21 echo "boundary_invalid: sensitive credential path is tracked" >&2 22 exit 1 23 fi 24 if git grep -I -n -E -e '-----BEGIN ([A-Z0-9 ]+ )?PRIVATE KEY-----|AKIA[0-9A-Z]{16}|gh[pousr]_[A-Za-z0-9_]{36,}|nsec1[023456789acdefghjklmnpqrstuvwxyz]{40,}' -- src >/dev/null; then 25 echo "boundary_invalid: production source contains credential material" >&2 26 exit 1 27 fi 28 29 echo "boundary ok: root-only API, fresh baseline, no forbidden or credential surface"