httpidentity

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package httpidentity applies B-leg User-Agent identity policy at the final HTTP wire boundary for approved hosted connectors.

It clones requests before mutation, resolves identity from identity.FieldPolicy plus optional call-scoped client UA in context, and never mutates the shared upstream client passed from the composition root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrapClient

func WrapClient(client *http.Client, policy identity.FieldPolicy) *http.Client

WrapClient returns a shallow clone of client whose Transport applies policy. The input client is never mutated. Nil client yields nil.

Types

type Transport

type Transport struct {
	Base   http.RoundTripper
	Policy identity.FieldPolicy
}

Transport is an http.RoundTripper that sets, replaces, or omits User-Agent according to Policy on every outbound request.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip clones req, applies User-Agent policy, and delegates to Base.

Jump to

Keyboard shortcuts

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