auth-isolation-check.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env bash
  2. # Human-assisted isolation check helper (S6.1 / Clerk gap).
  3. # Does NOT create projects. Prints the exact clicks + optional API probes
  4. # if you pass two project-scoped auth public keys (pk_ only — never brk_ in browser).
  5. #
  6. # Usage:
  7. # ./scripts/auth-isolation-check.sh
  8. # ./scripts/auth-isolation-check.sh p_AAA p_BBB
  9. set -euo pipefail
  10. API="${BRIVEN_API_ORIGIN:-https://api.briven.tech}"
  11. A="${1:-}"
  12. B="${2:-}"
  13. cat <<EOF
  14. == Auth isolation check (project A vs project B) ==
  15. In the dashboard (you must do this — takes ~10 minutes):
  16. 1. Project A → Auth → enable (if needed) → create public key pk_… for A
  17. 2. Sign up a user on A's hosted auth / your pilot (e.g. you+a@email.com)
  18. 3. Project B → Auth → enable → create a DIFFERENT public key for B
  19. 4. Project B → Auth → Users
  20. PASS = user from step 2 is NOT listed
  21. 5. (Optional) Configure a second app with B's project id + B's pk_
  22. Sign up another user → appears only on B
  23. Why this matters: Clerk multi-app isolation is assumed; we must show it.
  24. Platform readiness (agent):
  25. EOF
  26. ./scripts/s6-auth-verify.sh "$API" || true
  27. if [[ -n "$A" && -n "$B" ]]; then
  28. echo
  29. echo "Optional: if you export BRIVEN_PEN_TEST_* tokens, run:"
  30. echo " BRIVEN_PEN_TEST_RUN=1 BRIVEN_PEN_TEST_TENANT_A_ID=$A BRIVEN_PEN_TEST_TENANT_B_ID=$B \\"
  31. echo " BRIVEN_PEN_TEST_API_ORIGIN=$API bun test apps/api/src/services/auth-tenant-isolation.test.ts"
  32. fi
  33. echo
  34. echo "Record results in docs/CLERK-GAP-EVIDENCE.md and AUTH-GO-LIVE-CHECKLIST.md"