mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-07-18 13:43:38 +00:00
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Pre-commit / pre-commit (push) Has been cancelled
Test / Run Web + Local Brain Smoke (push) Has been cancelled
Test / Run Frontend Guardrails (push) Has been cancelled
Test / Run Python Tests (push) Has been cancelled
Co-authored-by: Douglas <douglas.ym.lai@gmail.com> Co-authored-by: Douglas Lai <115660088+Douglasymlai@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Tao Sun <168447269+fengju0213@users.noreply.github.com> Co-authored-by: Weijie Bai <happy.regina.bai@gmail.com>
23 lines
654 B
Bash
23 lines
654 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
# Guardrail for web separation:
|
|
# only src/host/createHost.ts may read window.electronAPI/window.ipcRenderer.
|
|
violations="$(
|
|
rg -n \
|
|
-e 'window\s*(\?\.)?\s*\.\s*(electronAPI|ipcRenderer)' \
|
|
-e '\(window\s+as\s+any\)\s*\.\s*(electronAPI|ipcRenderer)' \
|
|
-e 'window\s*\[\s*["'\''](electronAPI|ipcRenderer)["'\'']\s*\]' \
|
|
--glob '*.{ts,tsx,js,jsx}' \
|
|
--glob '!src/host/createHost.ts' \
|
|
src || true
|
|
)"
|
|
|
|
if [[ -n "${violations}" ]]; then
|
|
echo "Found forbidden direct Electron window access outside Host bridge:"
|
|
echo "${violations}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Electron window access guard passed."
|