Skip to content

[Export Audit] Unnecessarily exported internal helpers in src/squid/ submodules (regression from #3867) #3924

@github-actions

Description

@github-actions

API Surface Issue

Category

Unused export (internal implementation details exposed as public API)

Summary

  • Files: src/squid/access-rules.ts, src/squid/acl-generator.ts, src/squid/config-sections.ts
  • Symbols: generateProtocolRules, generateDenyRule, generateAccessRulesSection, generateDomainAcls, generateBlockedDomainAcls, generateConfigSections
  • Issue: All six exported functions are only ever consumed by src/squid/config-generator.ts (within the same squid/ directory). They are internal helpers with no usage outside the squid/ module and no barrel/index re-export.

Evidence

Imports in src/squid/config-generator.ts (the only consumer):

src/squid/config-generator.ts:import { generateDomainAcls, generateBlockedDomainAcls } from './acl-generator';
src/squid/config-generator.ts:import { generateAccessRulesSection, generateDenyRule, generateProtocolRules } from './access-rules';
src/squid/config-generator.ts:import { generateConfigSections } from './config-sections';

No references outside src/squid/:

$ grep -rw "from.*access-rules\|from.*acl-generator\|from.*config-sections" src --include="*.ts" | grep -v "^src/squid/"
(no output)

No test files reference these symbols directly:

$ grep -rw "generateDenyRule\|generateAccessRulesSection\|generateProtocolRules\|generateDomainAcls\|generateBlockedDomainAcls\|generateConfigSections" src --include="*.test.ts"
(no output)

Context

Issue #3867 addressed a similar problem for generateDlpSections, generateSslSections, generatePortAclsAndRules, generateApiProxySection, and generateDnsSection in config-sections.ts. That issue was closed as completed, but the remaining export generateConfigSections and the exports in access-rules.ts and acl-generator.ts were not addressed.

Recommended Fix

Remove the export keyword from the six functions:

// src/squid/access-rules.ts
-export function generateProtocolRules(...)
+function generateProtocolRules(...)

-export function generateDenyRule(...)
+function generateDenyRule(...)

-export function generateAccessRulesSection(...)
+function generateAccessRulesSection(...)

// src/squid/acl-generator.ts
-export function generateDomainAcls(...)
+function generateDomainAcls(...)

-export function generateBlockedDomainAcls(...)
+function generateBlockedDomainAcls(...)

// src/squid/config-sections.ts
-export function generateConfigSections(...)
+function generateConfigSections(...)

Impact

  • Dead code risk: Low (functions are used internally, but the export widens the API surface unnecessarily)
  • Maintenance burden: Medium — any refactor of these internal helpers must now treat them as public API, creating friction

Detected by Export Audit workflow. Triggered by push to main on 2026-05-27

Generated by API Surface & Export Audit · sonnet46 1.2M ·

  • expires on Jun 26, 2026, 4:33 AM UTC

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions