Skip to content

fix: unexport internal helpers from ssl-bump and host-iptables#2532

Merged
lpcox merged 2 commits intomainfrom
fix/export-audit-internal-helpers
May 5, 2026
Merged

fix: unexport internal helpers from ssl-bump and host-iptables#2532
lpcox merged 2 commits intomainfrom
fix/export-audit-internal-helpers

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented May 5, 2026

Summary

Removes unnecessary exports from internal helper functions in security-critical modules.

Changes

  1. mountSslTmpfs (src/ssl-bump.ts): Removed export — only called within the same file
  2. getDockerBridgeGateway (src/host-iptables.ts): Removed export — only called within the same file
  3. _resetIpv6State (src/host-iptables.ts): Moved behind __testing namespace — removes direct export of a mutable state reset function from the public API while preserving test access

Verification

  • npm run build
  • host-iptables.test.ts — 37 tests pass ✅
  • ssl-bump.test.ts — 39 tests pass ✅

Closes #2524
Closes #2531

- 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>
@lpcox lpcox requested a review from Mossaka as a code owner May 5, 2026 03:09
Copilot AI review requested due to automatic review settings May 5, 2026 03:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 86.46% 86.53% 📈 +0.07%
Statements 86.39% 86.46% 📈 +0.07%
Functions 90.61% 90.61% ➡️ +0.00%
Branches 79.23% 79.27% 📈 +0.04%
📁 Per-file Coverage Changes (3 files)
File Lines (Before → After) Statements (Before → After)
src/host-iptables.ts 88.8% → 88.7% (-0.04%) 88.5% → 88.5% (-0.04%)
src/ssl-bump.ts 94.8% → 94.8% (-0.04%) 94.1% → 94.1% (-0.05%)
src/container-lifecycle.ts 86.1% → 87.2% (+1.09%) 86.3% → 87.4% (+1.08%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() in src/ssl-bump.ts (module-internal helper).
  • Unexports getDockerBridgeGateway() in src/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

Comment thread src/host-iptables.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Smoke Test Results

✅ GitHub MCP: Last 2 merged PRs retrieved

✅ Playwright: GitHub homepage loads (title contains "GitHub")

✅ File Writing: Test file created at /tmp/gh-aw/agent/smoke-test-claude-25355820326.txt

Status: PASS

💥 [THE END] — Illustrated by Smoke Claude

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3
Node.js v24.14.1 v20.20.2
Go go1.22.12 go1.22.12

Result: ❌ Not all versions match — Python and Node.js differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions github-actions Bot mentioned this pull request May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #2532 · ● 421K ·

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

fix(api-proxy): strip accidental "Bearer " prefix in BYOK Copilot auth token
api-proxy: listen on all ports unconditionally, return clear errors for missing credentials
GitHub MCP review ❌
safeinputs-gh PR query ❌
Playwright GitHub title ✅
Tavily search ❌
File write/read ✅
Discussion oracle comment ✅
AWF build ✅
Overall: FAIL

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Smoke Test Results — Services Connectivity

Check Result
Redis PING (host.docker.internal:6379) ❌ Connection timeout
PostgreSQL pg_isready (host.docker.internal:5432) ❌ No response
PostgreSQL SELECT 1 ❌ Skipped (no connection)

Overall: FAIL

host.docker.internal resolves to 172.17.0.1 but both ports timed out. The GitHub Actions service containers appear unreachable from this runner environment.

🔌 Service connectivity validated by Smoke Services

@lpcox lpcox merged commit 6704a82 into main May 5, 2026
65 of 68 checks passed
@lpcox lpcox deleted the fix/export-audit-internal-helpers branch May 5, 2026 03:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🔬 Smoke Test Results

Test Status
GitHub MCP connectivity
GitHub.com HTTP connectivity ✅ (pre-step)
File write/read smoke-test-copilot-25376911664.txt

PR: fix: unexport internal helpers from ssl-bump and host-iptables
Author: @lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Smoke Test: Copilot BYOK — PR #2532 by @lpcox

Test Result
GitHub MCP (list PRs)
GitHub.com connectivity
File write/read
BYOK inference (this response)

Running in BYOK offline mode (COPILOT_OFFLINE=true) via api-proxy → api.githubcopilot.com

Overall: PASS

🔑 BYOK report filed by Smoke Copilot BYOK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants