refactor(embed): drop dead Embedded.HTTPAddr accessor

Provably-dead exported accessor: no in-repo callers (only cmd/kmsd and
mount.go consume the root package) and no external importer of
github.com/hanzoai/kms across the tree uses it. Its backing httpAddr
field was write-only and its comment was wrong (stored the raw config
addr, never a resolved listener address). Removes field, assignment,
and accessor. Build+vet green.
This commit is contained in:
Hanzo Dev
2026-07-18 11:02:07 -07:00
parent f021830ebf
commit c5d633bf3a
-12
View File
@@ -133,8 +133,6 @@ type Embedded struct {
replicator *badger.Replicator
auditCancel context.CancelFunc
zapNode *zap.Node // nil when ZAP server disabled
httpAddr string // bound listener address (post-:0 resolution)
}
// Embed boots the Hanzo KMS server in-process and returns a handle.
@@ -237,7 +235,6 @@ func Embed(ctx context.Context, cfg EmbedConfig) (*Embedded, error) {
WriteTimeout: 60 * time.Second,
IdleTimeout: 120 * time.Second,
}
em.httpAddr = cfg.HTTPAddr
go func() {
log.Info("kms.Embed: HTTP listening", "addr", cfg.HTTPAddr)
if err := em.httpServer.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
@@ -264,15 +261,6 @@ func (e *Embedded) HTTPHandler() http.Handler {
return e.handler
}
// HTTPAddr returns the bound listen address. Returns "" when
// SkipListen=true or before the listener has been wired.
func (e *Embedded) HTTPAddr() string {
if e == nil || e.cfg.SkipListen {
return ""
}
return e.httpAddr
}
// ZAPPort returns the ZAP secrets-server port (0 when disabled).
func (e *Embedded) ZAPPort() int {
if e == nil || e.zapNode == nil {