httputil

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package httputil provides HTTP client and transport utilities used across Genie.

It solves the problem of centralizing TLS configuration (NIST 2030 minimums: TLS 1.2+, strong ciphers) so that all outbound HTTP calls use a consistent, secure default. SetDefaultTLSConfig is called at startup from config; GetClient and NewRoundTripper then use it for MCP, web search, OAuth, and other HTTP clients. Without this package, each integration would configure TLS separately and security policy would be harder to enforce.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(requestEnhancer ...RequestEnhancer) *http.Client

func NewRoundTripper

func NewRoundTripper(requestEnhancer ...RequestEnhancer) http.RoundTripper

NewRoundTripper returns an http.RoundTripper that uses NIST 2030–compliant TLS when SetDefaultTLSConfig has been called (min TLS 1.2, optional cipher restriction).

func SetDefaultTLSConfig

func SetDefaultTLSConfig(cfg *tls.Config)

SetDefaultTLSConfig sets the TLS config used by GetClient and NewRoundTripper. Call this at startup (e.g. from config) to enforce NIST 2030 minimums (TLS 1.2+). When nil, no custom TLS config is applied (Go defaults apply). The config is cloned so later mutation by the caller does not affect the default.

Types

type RequestEnhancer

type RequestEnhancer func(req *http.Request)

type RoundTripper

type RoundTripper struct {
	// contains filtered or unexported fields
}

func (*RoundTripper) RoundTrip

func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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