proxy

package
v1.9.8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 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.9.0

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

GetTLSConfigForCluster returns a tls config for the cluster.

func ImpersonateToken added in v1.8.0

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

ImpersonateToken returns the impersonate token of the cluster.

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

ParseProxyHeaders parses the proxy headers.

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)

SecretGetterFunc is a function to get secret.

type UpgradeAwareHandler added in v1.6.3

type UpgradeAwareHandler struct {
	proxyutil.UpgradeAwareHandler

	UpgradeDialer *UpgradeDialer
}

UpgradeAwareHandler is an interface for dialing a backend for an upgrade request

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