fix: unexport internal helpers from ssl-bump and host-iptables#2532
fix: unexport internal helpers from ssl-bump and host-iptables#2532
Conversation
- Remove export from mountSslTmpfs (ssl-bump.ts) — only used internally - Remove export from getDockerBridgeGateway (host-iptables.ts) — only used internally - Move _resetIpv6State behind __testing namespace — removes direct export of test-only mutable state reset from security-critical module Closes #2524 Closes #2531 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
This PR reduces the exported API surface of security-sensitive modules (ssl-bump and host-iptables) by making module-local helpers non-exported and by moving a test-only state reset helper behind a dedicated testing namespace.
Changes:
- Unexports
mountSslTmpfs()insrc/ssl-bump.ts(module-internal helper). - Unexports
getDockerBridgeGateway()insrc/host-iptables.ts(module-internal helper). - Replaces direct export of
_resetIpv6State()with__testing._resetIpv6State()for test access.
Show a summary per file
| File | Description |
|---|---|
| src/ssl-bump.ts | Removes an unnecessary export of a module-local tmpfs mount helper. |
| src/host-iptables.ts | Removes an unnecessary export, and introduces a __testing namespace for a test-only reset hook. |
| src/host-iptables.test.ts | Updates tests to call the reset hook via __testing. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Smoke Test Results ✅ GitHub MCP: Last 2 merged PRs retrieved
✅ Playwright: GitHub homepage loads (title contains "GitHub") ✅ File Writing: Test file created at Status: PASS
|
Chroot Version Comparison Results
Result: ❌ Not all versions match — Python and Node.js differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
|
fix(api-proxy): strip accidental "Bearer " prefix in BYOK Copilot auth token Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test Results — Services Connectivity
Overall: FAIL
|
🔬 Smoke Test Results
PR: fix: unexport internal helpers from ssl-bump and host-iptables Overall: PASS ✅
|
|
Smoke Test: Copilot BYOK — PR #2532 by
Running in BYOK offline mode ( Overall: PASS
|
Summary
Removes unnecessary exports from internal helper functions in security-critical modules.
Changes
mountSslTmpfs(src/ssl-bump.ts): Removedexport— only called within the same filegetDockerBridgeGateway(src/host-iptables.ts): Removedexport— only called within the same file_resetIpv6State(src/host-iptables.ts): Moved behind__testingnamespace — removes direct export of a mutable state reset function from the public API while preserving test accessVerification
npm run build✅host-iptables.test.ts— 37 tests pass ✅ssl-bump.test.ts— 39 tests pass ✅Closes #2524
Closes #2531