feat(agent-proxy): resolve connect config from flag, env, and .infisical.json#319
feat(agent-proxy): resolve connect config from flag, env, and .infisical.json#319saifsmailbox98 wants to merge 3 commits into
Conversation
|
💬 Discussion in Slack: #pr-review-cli-319-feat-agent-proxy-resolve-connect-config-from-flag-env-and-infi Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| packages/cmd/agent_proxy.go | Replaces inline flag reads with resolver helpers for env/path/proxy; delegation is clean and error messages improved |
| packages/util/helper.go | Four new resolver functions added: ResolveEnvironmentName, ResolveSecretPath, ResolveAgentProxyAddress, GetBoolFlagOrEnv — all use Changed() correctly to differentiate explicit flag vs default |
| packages/util/resolve_test.go | New unit tests covering all four resolver functions with flag, env, file, and default priority paths; flag defaults match production command registration |
| packages/util/secrets.go | GetSecretPathFromWorkspaceFile added, mirroring the existing GetEnvFromWorkspaceFile pattern |
| packages/models/cli.go | Adds DefaultSecretPath to WorkspaceConfigFile with omitempty; backward-compatible addition |
| packages/util/constants.go | Adds INFISICAL_ENVIRONMENT_NAME, INFISICAL_SECRET_PATH_NAME, and two agent-proxy-specific constant names |
Reviews (2): Last reviewed commit: "fix(agent-proxy): do not source the prox..." | Re-trigger Greptile
|
On the greptile security note about the proxy address coming from |
|
@greptile review |
Description 📣
Adds flag → env →
.infisical.jsonconfig resolution toagent-proxy connect. Each setting can come from a flag, an env var, or.infisical.json, and an explicit flag always wins..infisical.json--proxyINFISICAL_AGENT_PROXY_ADDRESS--envINFISICAL_ENVIRONMENTdefaultEnvironment--pathINFISICAL_SECRET_PATHdefaultSecretPathThe proxy address is deliberately not read from
.infisical.json. That file is usually committed to a repo, and unlike the other settings (which fail loudly if wrong), a bad proxy address would silently route all agent traffic and its auth token through the wrong host. It resolves from the flag or env var only.Scoped to
connectonly.run,export,secrets,folder, anddynamic-secretsare untouched (byte-identical to before), so no existing command changes behavior. Resolution logic lives inutil/helper.goand is unit-tested inutil/resolve_test.go.Companion docs PR: Infisical/infisical#7336
Type ✨
Tests 🛠️
# Here's some code block to paste some code snippets