Documentation
¶
Overview ¶
Package gomodproxy serves the Go module proxy protocol on loopback so the Dependency Firewall can check module zips without a MITM certificate: go and git on macOS trust only the system store, and installing the firewall's CA there needs sudo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend serves allowed module proxy requests through goproxy and owns the temp tree goproxy fetches into.
func NewBackend ¶
func NewBackend(goBin string, proxiedSumDBs []string, envOverrides map[string]string, upstreamCAs []byte) (*Backend, error)
NewBackend builds a goproxy handler that fetches through goBin. proxiedSumDBs lists the checksum databases served under /sumdb/, as goproxy's "name" or "name URL" entries. envOverrides replaces the fetcher environment's value for each key it sets, GOPROXY included, except the isolation pins, which always win. upstreamCAs, PEM certificates trusted on top of the system roots, covers goproxy's own requests and, where newBackend allows it, the go subprocess.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves the Go module proxy protocol on loopback and gates module zip downloads against the Dependency Firewall.
The backend's fetcher carries the user's version-control credentials, so only a client that knows the per-run path token and addresses the listener by its own address reaches it: that excludes other local processes and DNS-rebinding web pages.
func (*Server) BaseURL ¶
BaseURL is the value to hand the child as GOPROXY. It is empty before Start.
func (*Server) CheckedZips ¶
CheckedZips reports how many module zips got a policy decision.