Skip to content

Commit 790516b

Browse files
tphoneyactions-user
authored andcommitted
Added tests for all proxy related code in the overmind CLI. (#2992)
## Fix AWS SDK v2 Proxy Configuration and Add Comprehensive Proxy Tests ### Problem We needed to assess whether or not we've supported proxies in the CLI in order to make sure that we can use this at one of our customers. ### Audit Summary An audit of HTTP clients found one issue (now fixed). All other clients already respect proxy settings: - ✅ `otelhttp.DefaultClient` (uses `http.DefaultTransport`) - ✅ AWS SDK with Terraform provider config (explicitly configured) - ✅ GCP SDK, Kubernetes client-go, WebSocket dialers (all use transports that respect proxy) - ✅ ⚠️ AWS SDK v2 default config (now fixed) ### Solution **1. Fixed AWS SDK v2 Default Configuration** (`cli/cmd/explore.go`) - Configured AWS SDK v2 HTTP client to use `http.ProxyFromEnvironment` when falling back to default credentials - Ensures consistent proxy behavior across all AWS SDK usage scenarios **2. Added Comprehensive Proxy Tests** (`cli/cmd/auth_client_test.go`) - Created test infrastructure with a mock HTTP proxy server - Added tests for: - `newRetryableHTTPClient()` proxy configuration - `AuthenticatedChangesClient` proxy preservation through transport chain - WebSocket dialer proxy support (HTTP CONNECT) - Tests use `localhost.df.overmind-demo.com` (resolves to 127.0.0.1) to avoid proxy bypass ### Verification All tests pass: - `TestNewRetryableHTTPClientRespectsProxy` - `TestAuthenticatedChangesClientUsesProxy` - `TestWebSocketDialerUsesProxy` GitOrigin-RevId: f10d00e85ee193028923885e491936bec02203c9
1 parent ca99975 commit 790516b

2 files changed

Lines changed: 452 additions & 1 deletion

File tree

0 commit comments

Comments
 (0)