react-test-harness: network allowlist follow-ups from #6758
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- playwright, typescript
Direzione di ricerca
Start in packages/React/test-harness, reading component-runner.ts, network-guard.integration.test.ts, and connect.integration.test.ts; first check how ComponentRunner derives declared libraries and how the integration suites are gated by RUN_BROWSER_INTEGRATION=1. The issue describes four separate follow-ups, from allowlist tests to CI and attached-browser handling, so choose one and confirm its scope with maintainers. Done means the selected behavior has a focused test or CI job that covers the case described.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-ups from #6758, which added a network allowlist and an allowlisting proxy to @memberjunction/react-test-harness. Reviewers raised these as non-blocking, and they were split out of that PR.
1. Allow only the libraries a component declares
ComponentRunner allows the origin of every registered Component Library (CDNUrl, CDNCssUrl) on every page, whatever libraries the component under test declares. Not every one of those origins is a static CDN: at least one is an authenticated API host. A component can therefore send requests to any registered library's origin.
Proposed: build the allowlist from the component's declared libraries, including those of its child components, plus the core runtime. Check that the runtime's ComponentCompiler never needs an undeclared library before narrowing.
2. Pin the AllowNetworkUrls calls in ComponentRunner
Removing either AllowNetworkUrls(...) call in component-runner.ts passes every test: the library URLs in ExecuteComponent, and the core runtime URLs in loadRuntimeLibraries. The failure mode is fail-closed (every component run fails to load React or its libraries), but nothing catches it.
Proposed: a test that runs ComponentRunner with a mocked BrowserManager and asserts both calls are made with the expected URLs, fallback CDN URLs included.
3. WebRTC over UDP in attached browsers
When the harness launches the browser, it passes flags (BROWSER_LAUNCH_ARGS) that keep WebRTC on the allowlisting proxy and turn its UDP off. An attached browser (connect / MJ_REACT_TEST_HARNESS_CONNECT) keeps the flags it was started with. There, only the init script that removes the WebRTC constructors stands in the way of UDP STUN/TURN traffic, and a script can be raced. TCP is still refused at the proxy.
Options: document the flags an attached browser must be started with and warn when they can't be confirmed, or refuse allowlist mode on an attached browser unless the caller confirms the flags.
4. Run the real-browser suite in CI
network-guard.integration.test.ts (and connect.integration.test.ts) run only with RUN_BROWSER_INTEGRATION=1, so CI runs none of them. They are the only tests that prove the guard in a real browser. The proxy's socket-level tests (network-proxy.test.ts) do run in CI.
Proposed: a CI job that installs Playwright's Chromium and runs these suites, at least when packages/React/test-harness changes.
Package: packages/React/test-harness.
🤖 Generated with Claude Code
- Lingua principale
- TSQL
- Stelle
- 32
- Fork
- 7
- Merge medio
- 1g 16h
- PR unite (30g)
- 504
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
MemberJunction/MJ#7094 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
MemberJunction/MJ#6971 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MemberJunction/MJ#6947 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MemberJunction/MJ#6800 ·
I maintainer di solito rispondono entro 1 giorno
-
Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draftAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MemberJunction/MJ#6746 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MemberJunction/MJ
Issue simili
-
effort:s help wanted impact:med raised-by:reviewer risk:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
medici-finance/assay#8041 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts fileAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
danielmiessler/LifeOS#3123 ·
I maintainer di solito rispondono entro 5 giorni
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ohcnetwork/care_fe#17474 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
hemilabs/umami-analytics#12 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100