Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/cmd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ func runProxy(cmd *cobra.Command, args []string) error {
logProxyCmd.Printf("Resolved GitHub API URL: %s, explicit flag=%v", apiURL, proxyAPIURL != "")

// Create the proxy server
logProxyCmd.Printf("Creating proxy server: guard=%s, hasPolicy=%v, mode=%s, trustedBots=%d, trustedUsers=%d",
proxyGuardWasm, proxyPolicy != "", proxyDIFCMode, len(proxyTrustedBots), len(proxyTrustedUsers))
Comment on lines +206 to +207
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

PR description says this change adds 5 new logProxyCmd debug log calls, but this diff introduces 6 new calls (creating proxy server, created successfully, creating HTTP server, applying TLS config, configuring trust env, trust env configured). Please update the PR description/count to match the actual changes.

Copilot uses AI. Check for mistakes.
proxySrv, err := proxy.New(ctx, proxy.Config{
WasmPath: proxyGuardWasm,
Policy: proxyPolicy,
Expand All @@ -215,6 +217,7 @@ func runProxy(cmd *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("failed to create proxy server: %w", err)
}
logProxyCmd.Printf("Proxy server created successfully")

// Generate TLS certificates if requested
var tlsCfg *proxy.TLSConfig
Expand All @@ -235,11 +238,13 @@ func runProxy(cmd *cobra.Command, args []string) error {
}

// Create the HTTP server
logProxyCmd.Printf("Creating HTTP server: addr=%s, tls=%v", proxyListen, tlsCfg != nil)
httpServer := &http.Server{
Addr: proxyListen,
Handler: proxySrv.Handler(),
}
if tlsCfg != nil {
logProxyCmd.Printf("Applying TLS configuration to HTTP server")
httpServer.TLSConfig = tlsCfg.Config
}

Expand Down Expand Up @@ -318,10 +323,12 @@ func configureTLSTrustEnvironment(caCertPath string) error {
return fmt.Errorf("invalid TLS CA cert path contains newline")
}

logProxyCmd.Printf("Configuring TLS trust environment: caCertPath=%s, envVars=%v", caCertPath, tlsTrustEnvKeys)
for _, key := range tlsTrustEnvKeys {
if err := os.Setenv(key, caCertPath); err != nil {
return fmt.Errorf("failed to set %s: %w", key, err)
}
}
logProxyCmd.Printf("TLS trust environment configured successfully: %d env vars set", len(tlsTrustEnvKeys))
return nil
}
Loading