react-test-harness: network allowlist follow-ups from #6758
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- playwright, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TSQL
- Star
- 32
- Fork
- 7
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 504
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
MemberJunction/MJ#7094 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
MemberJunction/MJ#6971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MemberJunction/MJ#6947 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MemberJunction/MJ#6800 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draftĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MemberJunction/MJ#6746 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MemberJunction/MJ
Issue tương tự
-
area:infra kind:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
A-ci A-fuzzing C-bug S-confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hyperlight-dev/hyperlight#2134 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
effort:s help wanted impact:med raised-by:reviewer risk:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
medici-finance/assay#8041 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[bug] Socrates launchd-path adapter throws EISDIR when an import names a folder beside its .ts fileĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
danielmiessler/LifeOS#3123 ·
Maintainer thường phản hồi trong vòng 5 ngày