kubernetes/staging/src/k8s.io/client-go/transport/round_trippers.go

// HTTPWrappersForConfig wraps a round tripper with any relevant layered
// behavior from the config. Exposed to allow more clients that need HTTP-like
// behavior but then must hijack the underlying connection (like WebSocket or
// HTTP2 clients). Pure HTTP clients should use the RoundTripper returned from
// New.
func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error) {}

// DebugWrappers wraps a round tripper and logs based on the current log level.
func DebugWrappers(rt http.RoundTripper) http.RoundTripper {}

type authProxyRoundTripper

var _

// NewAuthProxyRoundTripper provides a roundtripper which will add auth proxy fields to requests for
// authentication terminating proxy cases
// assuming you pull the user from the context:
// username is the user.Info.GetName() of the user
// uid is the user.Info.GetUID() of the user
// groups is the user.Info.GetGroups() of the user
// extra is the user.Info.GetExtra() of the user
// extra can contain any additional information that the authenticator
// thought was interesting, for example authorization scopes.
// In order to faithfully round-trip through an impersonation flow, these keys
// MUST be lowercase.
func NewAuthProxyRoundTripper(username, uid string, groups []string, extra map[string][]string, rt http.RoundTripper) http.RoundTripper {}

func (rt *authProxyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

// SetAuthProxyHeaders stomps the auth proxy header fields.  It mutates its argument.
func SetAuthProxyHeaders(req *http.Request, username, uid string, groups []string, extra map[string][]string) {}

func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) {}

func (rt *authProxyRoundTripper) WrappedRoundTripper() http.RoundTripper {}

type userAgentRoundTripper

var _

// NewUserAgentRoundTripper will add User-Agent header to a request unless it has already been set.
func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper {}

func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) {}

func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper {}

type basicAuthRoundTripper

var _

// NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a
// request unless it has already been set.
func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper {}

func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) {}

func (rt *basicAuthRoundTripper) WrappedRoundTripper() http.RoundTripper {}

const ImpersonateUserHeader

const ImpersonateUIDHeader

const ImpersonateGroupHeader

const ImpersonateUserExtraHeaderPrefix

type impersonatingRoundTripper

var _

// NewImpersonatingRoundTripper will add an Act-As header to a request unless it has already been set.
func NewImpersonatingRoundTripper(impersonate ImpersonationConfig, delegate http.RoundTripper) http.RoundTripper {}

func (rt *impersonatingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) {}

func (rt *impersonatingRoundTripper) WrappedRoundTripper() http.RoundTripper {}

type bearerAuthRoundTripper

var _

// NewBearerAuthRoundTripper adds the provided bearer token to a request
// unless the authorization header has already been set.
func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper {}

// NewBearerAuthWithRefreshRoundTripper adds the provided bearer token to a request
// unless the authorization header has already been set.
// If tokenFile is non-empty, it is periodically read,
// and the last successfully read content is used as the bearer token.
// If tokenFile is non-empty and bearer is empty, the tokenFile is read
// immediately to populate the initial bearer token.
func NewBearerAuthWithRefreshRoundTripper(bearer string, tokenFile string, rt http.RoundTripper) (http.RoundTripper, error) {}

func (rt *bearerAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) {}

func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper {}

type requestInfo

// newRequestInfo creates a new RequestInfo based on an http request
func newRequestInfo(req *http.Request) *requestInfo {}

// complete adds information about the response to the requestInfo
func (r *requestInfo) complete(response *http.Response, err error) {}

// toCurl returns a string that can be run as a command in a terminal (minus the body)
func (r *requestInfo) toCurl() string {}

type debuggingRoundTripper

var _

type DebugLevel

const DebugJustURL

const DebugURLTiming

const DebugCurlCommand

const DebugRequestHeaders

const DebugResponseStatus

const DebugResponseHeaders

const DebugDetailedTiming

// NewDebuggingRoundTripper allows to display in the logs output debug information
// on the API requests performed by the client.
func NewDebuggingRoundTripper(rt http.RoundTripper, levels ...DebugLevel) http.RoundTripper {}

func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) {}

var knownAuthTypes

// maskValue masks credential content from authorization headers
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization
func maskValue(key string, value string) string {}

func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *debuggingRoundTripper) WrappedRoundTripper() http.RoundTripper {}

func legalHeaderByte(b byte) bool {}

func shouldEscape(b byte) bool {}

func headerKeyEscape(key string) string {}

var legalHeaderKeyBytes