federationhttp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package federationhttp owns bounded, direct federation HTTP transport. It shares the DNS/address policy used by SAML metadata and authenticated adapters.

Index

Constants

View Source
const (
	Deadline      = 15 * time.Second
	DocumentBytes = 1 << 20
	TokenBytes    = 256 << 10
)
View Source
const MaxCABundleBytes = 64 << 10

MaxCABundleBytes bounds administrator-supplied trust anchors.

Variables

View Source
var ErrTransport = errors.New("federation: outbound request refused or failed")

Functions

func NewClient

func NewClient(policy Policy, maxBytes int64) (*http.Client, error)

NewClient copies policy so later caller mutation cannot widen the client. Environment proxies are intentionally disabled: their remote DNS behavior cannot be treated as the local, approved address dialed by PublicDialer.

func ParseCABundle

func ParseCABundle(bundle string) (*x509.CertPool, error)

ParseCABundle accepts only PEM CA certificates. Supplied roots replace the system root store; private keys, junk and partial bundles fail closed.

func ValidateURL

func ValidateURL(raw string, development bool) (*url.URL, error)

ValidateURL rejects noncanonical authorities and credentials. Paths remain byte-exact because OIDC issuer identity must never be normalized.

Types

type Policy

type Policy struct {
	AllowedCIDRs map[string][]netip.Prefix
	Development  bool
}

Policy comes from local operator configuration, never provider discovery or an HTTP request. CIDRs are scoped to each exact endpoint origin. Development permits HTTP only for literal loopback addresses, not DNS names.

Jump to

Keyboard shortcuts

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