proxy

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidUser is returned for invalid user
	ErrInvalidUser = errors.New("invalid user")
)
View Source
var (

	// ErrNotSAToken is returned when secret refered by service account is not of type service account token
	ErrNotSAToken = errors.New("secert is not of type ServiceAccountToken")
)

Functions

func DeleteServiceAccount

func DeleteServiceAccount(key, paralusAuthzSA, paralusAuthzRole, paralusAuthzRoleBind string, delCache bool)

DeleteServiceAccount from cluster and cache

func InitPeerCacheRoundTripper

func InitPeerCacheRoundTripper() error

InitPeerCacheRoundTripper initialize the cache

func InitUnixCacheRoundTripper

func InitUnixCacheRoundTripper() error

InitUnixCacheRoundTripper initialize the cache

func NewCachedKubeHandler

func NewCachedKubeHandler(cfg *rest.Config, keepalive time.Duration) (*k8proxy.UpgradeAwareHandler, error)

NewCachedKubeHandler is cached kube handler

func NewCachedRoundTripper

func NewCachedRoundTripper(rt http.RoundTripper) (http.RoundTripper, error)

NewCachedRoundTripper returns new cached round tripper

func PeerKubeHandler

func PeerKubeHandler(tlscfg *tls.Config, relayIP string) (http.Handler, error)

PeerKubeHandler peer proxying handler

func UnixDialContext

func UnixDialContext(sockPath, key, username, sni string) func(ctx context.Context, network, addr string) (net.Conn, error)

UnixDialContext unix dial

func UnixKubeHandler

func UnixKubeHandler(sockPath, key, username, sni string) (http.Handler, error)

UnixKubeHandler unix handler

Types

type Func

type Func func(w io.Writer, r io.ReadCloser, msg *utils.ControlMessage, req *http.Request)

Func is responsible for forwarding a remote connection to local server and writing the response.

type TCPProxy

type TCPProxy struct {
	// contains filtered or unexported fields
}

TCPProxy forwards TCP streams.

func NewKubeCtlTCPProxy

func NewKubeCtlTCPProxy(lg *relaylogger.RelayLog, cfg *utils.ProxyConfig) *TCPProxy

NewKubeCtlTCPProxy creates new direct TCPProxy, everything will be proxied to unix socket.

func NewTCPProxy

func NewTCPProxy(lg *relaylogger.RelayLog, cfg *utils.ProxyConfig) *TCPProxy

NewTCPProxy creates new direct TCPProxy, everything will be proxied to unix socket.

func (*TCPProxy) Proxy

func (tp *TCPProxy) Proxy(w io.Writer, r io.ReadCloser, msg *utils.ControlMessage, req *http.Request)

Proxy is a ProxyFunc.

func (*TCPProxy) ServeHTTP

func (tp *TCPProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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