Documentation
¶
Overview ¶
Package securehttp provides outbound HTTP clients for remote MCP and OAuth services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidURL reports a URL that cannot be used as a remote HTTP destination. ErrInvalidURL = outboundpolicy.ErrInvalidURL // ErrInsecureTransport reports HTTP used for a non-loopback destination. ErrInsecureTransport = outboundpolicy.ErrInsecureTransport // ErrBlockedDestination reports an address outside the configured destination policy. ErrBlockedDestination = outboundpolicy.ErrBlockedDestination // ErrTooManyRedirects reports a redirect chain beyond the client's configured limit. ErrTooManyRedirects = errors.New("securehttp: too many redirects") // ErrResponseBodyTooLarge reports a response body that exceeds the configured limit. ErrResponseBodyTooLarge = errors.New("securehttp: response body exceeds the configured limit") )
Functions ¶
func RedactError ¶
RedactError removes request URLs and credentials from errors returned by APIs that require the underlying HTTP client.
func ValidateURL ¶
ValidateURL checks a URL against the default public-only destination policy.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an outbound HTTP client whose requests are checked against the MCP network policy.
func (*Client) HTTPClient ¶
HTTPClient returns the underlying client for APIs that require *http.Client. Call Do directly or pass API errors through RedactError at the boundary.
func (*Client) ValidateURL ¶
ValidateURL checks a URL against this client's static destination policy. DNS answers are revalidated immediately before every connection.
type Option ¶
type Option func(*options)
Option configures a Client.
func WithAllowLoopback ¶
WithAllowLoopback permits explicit loopback destinations, including HTTP. It is disabled by default so catalog destinations remain public-only.
func WithMaxResponseBodyBytes ¶
WithMaxResponseBodyBytes configures the maximum readable response body. A non-positive value keeps the default.
func WithTimeout ¶
WithTimeout configures the end-to-end timeout. A non-positive value keeps the default.