utilhandler

package
v1.133.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FetchPath = "/util/fetch"

FetchPath is the catalog path of the fetch_url operation. The embedded OpenAPI spec, the mux route here, and the path callers pass to api_invoke_endpoint / api_export must all agree on this literal.

Variables

This section is empty.

Functions

func New

func New(opts Options) (http.Handler, error)

New builds the util operations handler the api gateway dispatches handler=internal connections to. The returned handler serves the operations the embedded catalog spec (SpecJSON) declares; the two are versioned together in this package so they cannot drift.

Every outbound dial passes the shared egress guard, whose transport ignores proxy environment variables: an egress proxy sits inside the network perimeter, and routing a guarded fetch through it would let the proxy reach a destination the guard just refused.

func SpecJSON

func SpecJSON() string

SpecJSON returns the embedded OpenAPI document for the util catalog.

Types

type Options

type Options struct {
	// AllowPrivateCIDRs lists prefixes exempted from the internal-range
	// SSRF block (apigateway.util_connection.allow_private_cidrs).
	// Empty means the default posture: public destinations open,
	// internal address space closed. An exemption grants ANY TCP port
	// on the listed range, so scope it to the specific host prefixes a
	// deployment must fetch from — a broad grant turns fetch_url into an
	// internal port-reach primitive.
	AllowPrivateCIDRs []string
}

Options configures the util handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL