refactor: consolidate TLS helpers — move LoadGatewayTLS from server into httputil - #9404
Merged
lpcox merged 2 commits intoJul 15, 2026
Merged
Conversation
5 tasks
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
lpcox
marked this pull request as ready for review
July 15, 2026 21:20
Contributor
There was a problem hiding this comment.
Pull request overview
Consolidates gateway TLS loading in internal/httputil without changing behavior.
Changes:
- Moves
LoadGatewayTLSand its tests fromservertohttputil. - 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
This was referenced Jul 15, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLS helpers were scattered across three packages:
internal/httputil(protocol-level helpers),internal/proxy(self-signed cert generation), andinternal/server(LoadGatewayTLS). Theserverplacement was wrong —LoadGatewayTLShas no server-package dependencies and is consumed only byinternal/cmd.Changes
LoadGatewayTLS→internal/httputil/tls.goalongsideNewServerTLSConfig(which it calls), consolidating all file-loading and protocol-level TLS helpers in one packageinternal/server/gateway_tls.go; updateinternal/cmd/root.goto callhttputil.LoadGatewayTLSinternal/httputil/tls_gateway_test.goaspackage httputil_test(external test package avoids thehttputil←proxy←httputilimport cycle)httputil/tls.goandproxy/tls.goto accurately describe the two-package splitResulting package responsibilities
internal/httputilMinTLSVersion,NewServerTLSConfig,NewClientTLSConfig,ConfigureTLSTrustEnvironment,LoadGatewayTLSinternal/proxyGenerateSelfSignedTLS— self-signed cert generation, proxy-specific