border0

package
v0.0.0-...-575b356 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxyConnection

func ProxyConnection(client net.Conn, remote net.Conn)

func Serve

func Serve(logger *zap.Logger, l net.Listener, hostname string, port int, socketType string) error

func TunnelHost

func TunnelHost() string

Types

type Border0API

type Border0API interface {
	GetUserID() (string, error)
	SignSSHKey(ctx context.Context, socketID string, publicKey []byte) (string, string, error)
	Evaluate(ctx context.Context, socket *models.Socket, clientIP, userEmail, sessionKey string) ([]any, map[string][]string, error)
	UpdateSession(updates models.SessionUpdate) error
	SignSshOrgCertificate(ctx context.Context, socketID, sessionID, userEmail string, ticket []byte, publicKey []byte) ([]byte, error)
	UploadRecording(content []byte, socketID, sessionKey, recordingID string) error
}

type E2EEncryptionConn

type E2EEncryptionConn struct {
	*tls.Conn
	Metadata *E2EEncryptionMetadata
}

type E2EEncryptionMetadata

type E2EEncryptionMetadata struct {
	ClientIP       string `json:"client_ip"`
	UserEmail      string `json:"user_email"`
	SessionKey     string `json:"session_key"`
	SshTicket      []byte `json:"ssh_ticket,omitempty"`
	AllowedActions []any  `json:"allowed_actions,omitempty"`
}

type PermanentError

type PermanentError struct {
	Message string
}

func (PermanentError) Error

func (e PermanentError) Error() string

type Socket

type Socket struct {
	SocketID                         string
	SocketType                       string
	UpstreamType                     string
	UpstreamUsername                 string
	ConnectorAuthenticationEnabled   bool
	EndToEndEncryptionEnabled        bool
	ConnectorAuthenticationTLSConfig *tls.Config

	Organization *models.Organization

	Socket           *models.Socket
	RecordingEnabled bool
	ConfigHash       string
	// contains filtered or unexported fields
}

func NewSocket

func NewSocket(ctx context.Context, border0API api.API, nameOrID string, logger *zap.Logger) (*Socket, error)

func NewSocketFromConnectorAPI

func NewSocketFromConnectorAPI(ctx context.Context, border0API Border0API, socket models.Socket, org *models.Organization, logger *zap.Logger, certificate *tls.Certificate) (*Socket, error)

func (*Socket) Accept

func (s *Socket) Accept() (net.Conn, error)

func (*Socket) Addr

func (s *Socket) Addr() net.Addr

func (*Socket) Close

func (s *Socket) Close() error

func (*Socket) GetContext

func (s *Socket) GetContext() context.Context

func (*Socket) IsClosed

func (s *Socket) IsClosed() bool

func (*Socket) Listen

func (s *Socket) Listen() (net.Listener, error)

func (*Socket) WithCertificate

func (s *Socket) WithCertificate(certificate *tls.Certificate)

func (*Socket) WithProxy

func (s *Socket) WithProxy(proxyHost string) error

func (*Socket) WithVersion

func (s *Socket) WithVersion(version string)

Jump to

Keyboard shortcuts

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