From 29930fa6bf98828af43ac93378ef9637b52ef385 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 2 Feb 2026 14:40:08 +0000 Subject: [PATCH] Track active proxy configurations --- go/extractor/util/registryproxy.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/go/extractor/util/registryproxy.go b/go/extractor/util/registryproxy.go index 1f20832e8d8..600c05a5af1 100644 --- a/go/extractor/util/registryproxy.go +++ b/go/extractor/util/registryproxy.go @@ -22,6 +22,19 @@ type RegistryConfig struct { URL string `json:"url"` } +func (config *RegistryConfig) Pretty() string { + pretty_type := "other" + + switch config.Type { + case GIT_SOURCE: + pretty_type = "Git Source" + case GOPROXY_SERVER: + pretty_type = "GOPROXY Server" + } + + return fmt.Sprintf("`%s` (%s)", config.URL, pretty_type) +} + // The address of the proxy including protocol and port (e.g. http://localhost:1234) var proxy_address string @@ -97,18 +110,22 @@ func getEnvVars() []string { if err != nil { slog.Error("Unable to parse proxy configurations", slog.String("error", err.Error())) } else { + activeConfigs := []RegistryConfig{} + // We only care about private registry configurations that are relevant to Go and // filter others out at this point. for _, cfg := range val { if cfg.Type == GOPROXY_SERVER { goproxy_servers = append(goproxy_servers, cfg.URL) slog.Info("Found GOPROXY server", slog.String("url", cfg.URL)) + activeConfigs = append(activeConfigs, cfg) } else if cfg.Type == GIT_SOURCE { parsed, err := url.Parse(cfg.URL) if err == nil && parsed.Hostname() != "" { git_source := parsed.Hostname() + parsed.Path + "*" git_sources = append(git_sources, git_source) slog.Info("Found Git source", slog.String("source", git_source)) + activeConfigs = append(activeConfigs, cfg) } else { slog.Warn("Not a valid URL for Git source", slog.String("url", cfg.URL)) }