internal

package
v0.0.0-...-514a694 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChainInterceptor

func NewChainInterceptor(interceptor ...proxy.Interceptor) proxy.Interceptor

NewChainInterceptor returns a new instance of the ChainInterceptor with the provided interceptors.

func NewSSHServer

func NewSSHServer(bind string, handler http.Handler, opts ...sshServerOption) (*sshServer, error)

func WithAuthHandler

func WithAuthHandler(auth AuthHandler) sshServerOption

func WithAuthorizedKeysAuth

func WithAuthorizedKeysAuth(fn string) sshServerOption

func WithGithubAuth

func WithGithubAuth() sshServerOption

func WithHostKeyFile

func WithHostKeyFile(fn string) sshServerOption

func WithRemoteAuth

func WithRemoteAuth(url string) sshServerOption

Types

type AuthHandler

type AuthHandler ssh.PublicKeyHandler

func AuthorizedKeysAuthHandler

func AuthorizedKeysAuthHandler(keys []ssh.PublicKey) AuthHandler

func MultiAuthHandler

func MultiAuthHandler(authz ...AuthHandler) AuthHandler

func NoAuthHandler

func NoAuthHandler() AuthHandler

func RemoteAuthHandler

func RemoteAuthHandler(url string) AuthHandler

type ChainInterceptor

type ChainInterceptor struct {
	Interceptors []proxy.Interceptor
}

ChainInterceptor is an interceptor that chains multiple interceptors together returning the first non-nil implementation. If all interceptors are exhausted, then the upstream is returned.

func (*ChainInterceptor) Intercept

func (i *ChainInterceptor) Intercept(l proxy.Logger, req *http.Request, upstream http.Handler) http.Handler

Intercept implements the proxy.Interceptor interface

type Config

type Config struct {
	Debug         bool
	HttpAddr      string
	SshAddr       string
	DockerURL     string
	TLSCACert     string
	TLSCert       string
	TLSKey        string
	AllowInsecure bool
}

Config ...

type InfoInterceptor

type InfoInterceptor struct {
	Docker *client.Client
}

func (*InfoInterceptor) Intercept

func (i *InfoInterceptor) Intercept(l proxy.Logger, req *http.Request, upstream http.Handler) http.Handler

type ReadOnlyInterceptor

type ReadOnlyInterceptor struct{}

func (*ReadOnlyInterceptor) Intercept

func (i *ReadOnlyInterceptor) Intercept(l proxy.Logger, req *http.Request, upstream http.Handler) http.Handler

type RulesInterceptor

type RulesInterceptor struct {
	Docker *client.Client

	Owner                     string
	AllowBinds                []string
	AllowHostModeNetworking   bool
	ContainerCgroupParent     string
	ContainerDockerLink       string
	ContainerJoinNetwork      string
	ContainerJoinNetworkAlias string
	User                      string
}

func (*RulesInterceptor) Intercept

func (i *RulesInterceptor) Intercept(l proxy.Logger, req *http.Request, upstream http.Handler) http.Handler

type Server

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

Server ...

func NewServer

func NewServer(cfg *Config) (*Server, error)

NewServer ...

func (*Server) Run

func (s *Server) Run() error

Run ...

type StdioAddr

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

StdioAddr implements net.Addr to provide an emulated network address for use with StdioConn.

func (*StdioAddr) Network

func (s *StdioAddr) Network() string

func (*StdioAddr) String

func (s *StdioAddr) String() string

type StdioConn

type StdioConn struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

StdioConn implements net.Conn to provide an emulated network connection between two processes over stdin/stdout.

func NewStdioConn

func NewStdioConn(localID, remoteID string, in io.ReadCloser, out io.WriteCloser) *StdioConn

func (*StdioConn) Close

func (sc *StdioConn) Close() error

func (*StdioConn) CloseRead

func (sc *StdioConn) CloseRead() error

func (*StdioConn) CloseWrite

func (sc *StdioConn) CloseWrite() error

func (*StdioConn) LocalAddr

func (sc *StdioConn) LocalAddr() net.Addr

func (*StdioConn) Read

func (sc *StdioConn) Read(b []byte) (int, error)

func (*StdioConn) RemoteAddr

func (sc *StdioConn) RemoteAddr() net.Addr

func (*StdioConn) SetDeadline

func (sc *StdioConn) SetDeadline(t time.Time) error

SetDeadline sets the read/write deadline.

func (*StdioConn) SetReadDeadline

func (sc *StdioConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read/write deadline.

func (*StdioConn) SetWriteDeadline

func (sc *StdioConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the read/write deadline.

func (*StdioConn) String

func (sc *StdioConn) String() string

func (*StdioConn) Write

func (sc *StdioConn) Write(b []byte) (int, error)

type StdioListener

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

StdioListener wraps a *StdioConn to implement net.Listener.

func NewStdioListener

func NewStdioListener(conn *StdioConn) *StdioListener

func (*StdioListener) Accept

func (sl *StdioListener) Accept() (net.Conn, error)

func (*StdioListener) Addr

func (sl *StdioListener) Addr() net.Addr

func (*StdioListener) Close

func (sl *StdioListener) Close() error

Jump to

Keyboard shortcuts

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