sdk

package
v0.0.0-...-af13ce4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	// The address of the relay server (ip:port or fqdn:port)
	Address string
	// Whether to connect to the relay in insecure mode (testing only)
	Insecure bool
	// Path to a CA Cert if the relay is using a self-signed certificate
	CACert string
	// SSH keypair which the relay server will verify and use to
	// authenticate the client with any daemons that connect.
	Signer ssh.Signer
}

type ControlContext

type ControlContext interface {
	RunCommand(*api.Command) (*api.CommandResponse, error)
	RunScript(*api.Script) (*api.ScriptResponse, error)
}

type KeyExchangeState

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

func NewKeyExchangeState

func NewKeyExchangeState() *KeyExchangeState

func (*KeyExchangeState) Complete

func (s *KeyExchangeState) Complete(
	serverEphPubKey []byte,
	clientEphPrivKey crypto.PrivateKey,
	clientEphPubKey crypto.PublicKey,
) error

func (*KeyExchangeState) ComputeSharedSecret

func (s *KeyExchangeState) ComputeSharedSecret() ([]byte, error)

func (*KeyExchangeState) ExchangeCompleted

func (s *KeyExchangeState) ExchangeCompleted() bool

func (*KeyExchangeState) KexResponse

func (s *KeyExchangeState) KexResponse() (*api.KexResponse, error)

func (*KeyExchangeState) Sign

func (s *KeyExchangeState) Sign(signer ssh.Signer, nonce []byte, sharedSecret []byte) ([]byte, error)

type NotifyCallback

type NotifyCallback func(ControlContext)

type RelayClient

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

func NewRelayClient

func NewRelayClient(conf *ClientConfig) (*RelayClient, error)

func (*RelayClient) Connect

func (rc *RelayClient) Connect(ctx context.Context) error

func (*RelayClient) Watch

func (rc *RelayClient) Watch(
	ctx context.Context,
	filter *api.BasicFilter,
	callback NotifyCallback,
) error

Jump to

Keyboard shortcuts

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