MCPcopy Index your code
hub / github.com/docker/docker-agent / newOpenAPIToolForTest

Function newOpenAPIToolForTest

pkg/tools/builtin/openapi/openapi_test.go:26–28  ·  view source on GitHub ↗

newOpenAPIToolForTest constructs an OpenAPITool 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].

(specURL string, headers map[string]string)

Source from the content-addressed store, hash-verified

24// compiled into release binaries. Production callers must use
25// [New].
26func newOpenAPIToolForTest(specURL string, headers map[string]string) *ToolSet {
27 return New(specURL, headers, WithAllowPrivateIPs(true), WithExpander(js.NewJsExpander(&testEnvProvider{})))
28}
29
30const petStoreSpec = `{
31 "openapi": "3.0.0",

Calls 4

NewJsExpanderFunction · 0.92
NewFunction · 0.70
WithAllowPrivateIPsFunction · 0.70
WithExpanderFunction · 0.70

Tested by

no test coverage detected