refactor(server): extract TLS / ACME helpers into server/tlscert#484
Closed
fuziontech wants to merge 1 commit intofeature/binary-split-pr3-pure-helpersfrom
Closed
Conversation
4 tasks
70224a0 to
3a139a9
Compare
e53dc96 to
f898455
Compare
5 tasks
3a139a9 to
2ea574f
Compare
Step 4 of the binary-split plan. Moves the TLS-cert and ACME (HTTP-01,
DNS-01) helpers out of the server/ package root into a focused
server/tlscert subpackage with no dependency on github.com/duckdb/duckdb-go.
Files moved:
server/certs.go → server/tlscert/certs.go
server/acme.go → server/tlscert/acme.go
server/acme_dns.go → server/tlscert/acme_dns.go
server/acme_test.go → server/tlscert/acme_test.go
server/acme_dns_test.go → server/tlscert/acme_dns_test.go
Backward compatibility preserved via type aliases and re-export `var`s in
server/tlscert_aliases.go:
server.ACMEManager is now an alias for tlscert.ACMEManager
server.ACMEDNSManager is now an alias for tlscert.ACMEDNSManager
server.NewACMEManager / NewACMEDNSManager / EnsureCertificates
are re-export `var`s pointing at tlscert.X
So existing references in main.go, tests/integration/harness.go,
controlplane/control.go, and the Server struct's acmeManager /
acmeDNSManager fields all compile unchanged. New code should import
server/tlscert directly.
The previously-private generateSelfSignedCert is now exported as
tlscert.GenerateSelfSignedCert because server_test.go calls it
directly to generate a cert pair without going through the
EnsureCertificates file-existence check.
PR #4 originally targeted querylog + checkpoint extraction. That hit
a chicken-and-egg with DuckLakeConfig: those constructors take the
server.Config struct, and the duckdb-bound config types haven't moved
to a leaf package yet on this branch (PR #1.5 does that on a parallel
branch). Pivoted to TLS/ACME as a self-contained alternative — same
shape as PR #3, no cycle issues. The querylog / checkpoint move will
land in PR #5 once the config types are sorted.
Verified:
- go build ./... clean
- go build -tags kubernetes ./... clean
- go test -short ./server/tlscert/... ./server/... ./controlplane/... ./
all green
- go list -deps ./server/tlscert | grep duckdb-go is empty
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
f898455 to
c2df749
Compare
5 tasks
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.
Summary
server/into a focusedserver/tlscert/subpackage with zeroduckdb-godependencyserver/tlscert_aliases.gogo list -deps ./server/tlscert | grep duckdb-goreturns emptyFiles moved
server/certs.goserver/tlscert/certs.goserver/acme.goserver/tlscert/acme.goserver/acme_dns.goserver/tlscert/acme_dns.goserver/acme_test.goserver/tlscert/acme_test.goserver/acme_dns_test.goserver/tlscert/acme_dns_test.goBackward-compat shim
server/tlscert_aliases.gokeeps existing references compiling unchanged:The previously-private
generateSelfSignedCertis now exported astlscert.GenerateSelfSignedCertbecauseserver_test.gocalls it directly to generate cert pairs without theEnsureCertificatesfile-existence check.Note on scope
PR #4 originally targeted
querylog.go+checkpoint.goextraction (those would do more for the goal — they directly linkduckdb-goviasql.Open("duckdb", ...)). That hit a chicken-and-egg problem: those constructors takeserver.Config(which embedsDuckLakeConfigandQueryLogConfig), and the duckdb-bound config types haven't moved to a leaf package on this branch yet. PR #1.5 (a parallel branch) does that work forDuckLakeConfig. Once #1.5 merges and this stack rebases, the querylog/checkpoint extraction lands in a follow-up PR.Pivoted to TLS/ACME for this PR because it's clean, self-contained, and progresses the goal in the same shape as PR #3.
Test plan
go build ./...cleango build -tags kubernetes ./...cleango test -short ./server/tlscert/... ./server/... ./controlplane/...— all greengo list -deps ./server/tlscert | grep duckdb-goreturns emptyStack
server/exec/server.go/conn.go/types.go's duckdb-bound branchescmd/duckgres-controlplaneandcmd/duckgres-worker🤖 Generated with Claude Code