MCPcopy Create free account
hub / github.com/docker/docker-agent / WithAllowPrivateIPs

Function WithAllowPrivateIPs

pkg/tools/builtin/api/api.go:126–128  ·  view source on GitHub ↗

WithAllowPrivateIPs disables SSRF dial-time protection so the api tool may dial loopback / RFC1918 / link-local addresses. Operators opt in via `allow_private_ips: true` when the configured endpoint legitimately targets internal services. Tests use this to talk to httptest.NewServer.

(allow bool)

Source from the content-addressed store, hash-verified

124// `allow_private_ips: true` when the configured endpoint legitimately
125// targets internal services. Tests use this to talk to httptest.NewServer.
126func WithAllowPrivateIPs(allow bool) Option {
127 return func(t *ToolSet) { t.allowPrivateIPs = allow }
128}
129
130func New(apiConfig latest.APIToolConfig, expander *js.Expander, opts ...Option) *ToolSet {
131 t := &ToolSet{

Callers 4

CreateToolSetFunction · 0.70
newAPIToolForTestFunction · 0.70

Calls

no outgoing calls