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