Files
devvm/internal/msg
w3cjandClaude Opus 5.5 ed70aeae3b feat(netpolicy): config.toml's company proxy reaches devvm's own downloads and builds' checks, and VMs without policy warn
config.toml's [proxy] covers the places it missed:

- devvm's own requests on this machine (the download of its mise, Ubuntu's
  cloud image listing, --from's registries) go through it when the
  environment sets no proxy. settings.CompanyProxy.Route is their
  transport's proxy: at the first request it looks up the proxy secret,
  puts it in each URL that names a user, and routes each request as a VM's
  proxy does (proxy.Upstream.WithPassword, proxy.Upstream.Route, reusing
  the proxy's NO_PROXY matching). A missing password fails the request
  with fetch.ErrProxy, which isn't retried; HostMise shows its message.
- The mise devvm runs on this machine gets HTTPS_PROXY, HTTP_PROXY and
  NO_PROXY in its environment (settings.CompanyProxy.Env), with the
  password in the URL, as mise takes it nowhere else; never in its
  arguments or a file. With the environment's proxy it adds nothing.
- devvm build, rebuild, the remakes' builds and tool builds check the
  company proxy and its saved password before anything starts
  (build.Builds' checkProxy, tools.Share.Build), through the one check a
  new VM and a VM's proxy use: settings.CompanyProxy.Upstream, which
  netpolicy.Proxy.Upstream now calls. secrets.Store.ProxyPassword owns
  the proxy_password_missing mapping.
- A VM without network policy never gets config.toml's proxy, as the
  guest would need the password, which never leaves this machine; each
  start of one while config.toml is the only proxy warns
  (proxy_needs_policy), naming devvm network on or the shell's
  HTTPS_PROXY, with a doc link.

Wiring: tools.Env.Proxy (its Password set by cli and vm from devvm's
secrets), from.NewLookup/NewRegistry/NewPublicRegistry take the proxy,
lima.New and registry.New take a *settings.CompanyProxy for Ubuntu's
listing. internal/fetch stays standard library only.

- Tests: TestUpstreamWithPassword, TestUpstreamRoute,
  TestUpstreamRouteAuthorizes, TestCompanyProxy,
  TestCompanyProxyPasswordMissing, TestProxyPassword,
  TestHostMiseThroughCompanyProxy, TestMiseCmdCompanyProxy,
  TestBuildChecksCompanyProxy (tools and build), TestRegistryThroughProxy,
  TestUbuntuThroughCompanyProxy, TestTransient's ErrProxy, and
  company_proxy.txtar's build, rebuild and no-policy cases.
- Docs: network policy's Behind a company proxy and Without network
  policy, config.toml's [proxy], How it works' Through a company proxy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 01:42:37 -07:00
..
2026-10-25 19:00:11 -06:00