proxy

package
v1.9.0-preview2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectCluster

func ConnectCluster(ctx context.Context, cluster *clusterapis.Cluster, proxyPath string, secretGetter SecretGetterFunc, responder registryrest.Responder) (http.Handler, error)

ConnectCluster returns a handler for proxy cluster.

func GetTlsConfigForCluster added in v1.8.0

func GetTlsConfigForCluster(ctx context.Context, cluster *clusterapis.Cluster, secretGetter SecretGetterFunc) (*tls.Config, error)

func ImpersonateToken added in v1.8.0

func ImpersonateToken(clusterName string, secret *corev1.Secret) (string, error)

func Location

func Location(cluster *clusterapis.Cluster, tlsConfig *tls.Config) (*url.URL, http.RoundTripper, error)

Location returns a URL to which one can send traffic for the specified cluster.

func NewThrottledUpgradeAwareProxyHandler

func NewThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder registryrest.Responder) *proxy.UpgradeAwareHandler

NewThrottledUpgradeAwareProxyHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.

func ParseProxyHeaders added in v1.6.3

func ParseProxyHeaders(proxyHeaders map[string]string) http.Header

func SkipGroup added in v1.8.0

func SkipGroup(group string) bool

SkipGroup tells whether the input group can be skipped during impersonate.

Types

type SecretGetterFunc added in v1.8.0

type SecretGetterFunc func(context.Context, string, string) (*corev1.Secret, error)

type UpgradeAwareHandler added in v1.6.3

type UpgradeAwareHandler struct {
	proxyutil.UpgradeAwareHandler

	UpgradeDialer *UpgradeDialer
}

func NewUpgradeAwareHandler added in v1.6.3

func NewUpgradeAwareHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder proxyutil.ErrorResponder) *UpgradeAwareHandler

NewUpgradeAwareHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.

func (*UpgradeAwareHandler) ServeHTTP added in v1.6.3

func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP handles the proxy request

type UpgradeDialer added in v1.6.3

type UpgradeDialer struct {

	// Dialer is the dialer used to connect.  Used if non-nil.
	Dialer *net.Dialer
	// contains filtered or unexported fields
}

UpgradeDialer knows how to upgrade an HTTP request to one that supports multiplexed streams. After Dial() is invoked, Conn will be usable.

func NewUpgradeDialerWithConfig added in v1.6.3

func NewUpgradeDialerWithConfig(cfg UpgradeDialerWithConfig) *UpgradeDialer

NewUpgradeDialerWithConfig creates a new UpgradeRoundTripper with the specified configuration.

func (*UpgradeDialer) Dial added in v1.6.3

func (u *UpgradeDialer) Dial(req *http.Request) (net.Conn, error)

Dial implements k8s.io/apimachinery/pkg/util/net.Dialer.

func (*UpgradeDialer) TLSClientConfig added in v1.6.3

func (u *UpgradeDialer) TLSClientConfig() *tls.Config

TLSClientConfig implements pkg/util/net.TLSClientConfigHolder for proper TLS checking during proxying with a roundtripper.

type UpgradeDialerWithConfig added in v1.6.3

type UpgradeDialerWithConfig struct {
	// TLS configuration used by the round tripper.
	TLS *tls.Config
	// Header holds the HTTP request headers for dialing. Optional.
	Header http.Header
	// Proxier is a proxy function invoked on each request. Optional.
	Proxier func(*http.Request) (*url.URL, error)
	// PingPeriod is a period for sending Pings on the connection.
	// Optional.
	PingPeriod time.Duration
}

UpgradeDialerWithConfig is a set of options for an UpgradeDialer.

Jump to

Keyboard shortcuts

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