Skip to content

refactor: consolidate TLS helpers — move LoadGatewayTLS from server into httputil - #9404

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering-analysis
Jul 15, 2026
Merged

refactor: consolidate TLS helpers — move LoadGatewayTLS from server into httputil#9404
lpcox merged 2 commits into
mainfrom
copilot/refactor-semantic-function-clustering-analysis

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

TLS helpers were scattered across three packages: internal/httputil (protocol-level helpers), internal/proxy (self-signed cert generation), and internal/server (LoadGatewayTLS). The server placement was wrong — LoadGatewayTLS has no server-package dependencies and is consumed only by internal/cmd.

Changes

  • Move LoadGatewayTLSinternal/httputil/tls.go alongside NewServerTLSConfig (which it calls), consolidating all file-loading and protocol-level TLS helpers in one package
  • Delete internal/server/gateway_tls.go; update internal/cmd/root.go to call httputil.LoadGatewayTLS
  • Relocate tests to internal/httputil/tls_gateway_test.go as package httputil_test (external test package avoids the httputilproxyhttputil import cycle)
  • Update package-level comments in httputil/tls.go and proxy/tls.go to accurately describe the two-package split
  • Remove stale logger-namespace exception for the deleted file

Resulting package responsibilities

Package Owns
internal/httputil MinTLSVersion, NewServerTLSConfig, NewClientTLSConfig, ConfigureTLSTrustEnvironment, LoadGatewayTLS
internal/proxy GenerateSelfSignedTLS — self-signed cert generation, proxy-specific

Copilot AI changed the title [WIP] Refactor semantic function clustering analysis for outliers and organization refactor: consolidate TLS helpers — move LoadGatewayTLS from server into httputil Jul 15, 2026
Copilot finished work on behalf of lpcox July 15, 2026 20:42
Copilot AI requested a review from lpcox July 15, 2026 20:42
@lpcox
lpcox marked this pull request as ready for review July 15, 2026 21:20
Copilot AI review requested due to automatic review settings July 15, 2026 21:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Consolidates gateway TLS loading in internal/httputil without changing behavior.

Changes:

  • Moves LoadGatewayTLS and its tests from server to httputil.
  • Updates callers, documentation, and logger namespace exceptions.
Show a summary per file
File Description
internal/server/gateway_tls.go Removes relocated TLS loader.
internal/httputil/tls.go Adds gateway TLS loading.
internal/httputil/tls_gateway_test.go Relocates TLS loader tests.
internal/cmd/root.go Uses the relocated helper.
internal/proxy/tls.go Updates TLS responsibility documentation.
internal/logger/logger_namespace_test.go Removes the obsolete exception.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Medium

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] Semantic Function Clustering Analysis — Outliers, Near-Duplicates, and Organization Issues

3 participants