Documentation
¶
Overview ¶
Package egress restricts where a provider request may go: only to the hosts a provider's manifest names, over HTTPS, without following a redirect to another host, and never to a private, loopback or link-local address, which is checked after DNS resolution so a rebinding name cannot reach one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRefused = errors.New("egress: refused")
ErrRefused is returned for a request the policy does not allow.
Functions ¶
Types ¶
type Policy ¶
type Policy struct {
// Hosts are the allowed hosts, with a port when not the default.
Hosts []string
// AllowPrivate permits private, loopback and link-local addresses. It is
// for development and tests only.
AllowPrivate bool
// AllowHTTP permits plain HTTP. It is for development and tests only.
AllowHTTP bool
// Transport is the base transport, cloned. The default is a clone of
// http.DefaultTransport.
Transport *http.Transport
// Timeout bounds a whole request. Default 30 seconds.
Timeout time.Duration
}
Policy is where requests may go.
Click to show internal directories.
Click to hide internal directories.