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

Function newAPIToolForTest

pkg/tools/builtin/api/api_test.go:27–29  ·  view source on GitHub ↗

newAPIToolForTest constructs an APITool that bypasses SSRF dial-time protection so tests can talk to httptest.NewServer (which binds to 127.0.0.1). It is defined in a *_test.go file so it is not compiled into release binaries. Production callers must use [New].

(apiConfig latest.APIToolConfig, expander *js.Expander)

Source from the content-addressed store, hash-verified

25// 127.0.0.1). It is defined in a *_test.go file so it is not compiled
26// into release binaries. Production callers must use [New].
27func newAPIToolForTest(apiConfig latest.APIToolConfig, expander *js.Expander) *ToolSet {
28 return New(apiConfig, expander, WithAllowPrivateIPs(true))
29}
30
31type testServer struct {
32 serverURL string

Callers 4

TestAPITool_GETFunction · 0.85
TestAPITool_POSTFunction · 0.85
TestAPITool_HeadersFunction · 0.85

Calls 2

NewFunction · 0.70
WithAllowPrivateIPsFunction · 0.70

Tested by

no test coverage detected