clt

package
v0.0.0-...-b1fd7ae Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSiteName = "teleconsole-client"

	// SyncRefreshIntervalMs defines the minimum amount of time it takes for
	// the local SSH server and the disposable proxy to synchronize the session
	// state (milliseconds)
	SyncRefreshInterval = time.Second
)

Functions

func Join

func Join(c *conf.Config, api *APIClient, sid string) error

Joins someone's session given its ID

func StartBroadcast

func StartBroadcast(c *conf.Config, api *APIClient, cmd []string) error

StartBroadcast starts a new SSH session exposed to the world via disposable SSH proxy.

This function:

  1. Generates a new SSH keypair and creates a temporary SSH server which trusts this pair.
  2. Sends the credentials via HTTPS to a Teleconsole server, which will create a single-use, single-tentant (just for us) SSH proxy
  3. Receives an ID of the server-side proxy session. That ID can be shared with other Teleconsole users so they could join this SSH session via proxy
  4. Launches shell. When the shell exits, the SSH session is also terminated disconnecting all parties.

Types

type APIClient

type APIClient struct {
	SessionID string
	Endpoint  *url.URL
	// contains filtered or unexported fields
}

APIClient is an HTTP client for talking to telecast server asking for new Teleport proxy instances

func NewAPIClient

func NewAPIClient(config *conf.Config, clientVersion string) *APIClient

NewAPIClient creates and returns the new API client

func (*APIClient) CheckVersion

func (this *APIClient) CheckVersion() error

Sends the version of the client to the server and receives a session cookie. Every new API conversation must start here

func (*APIClient) GET

func (this *APIClient) GET(url string) (*http.Response, error)

func (*APIClient) GetSessionDetails

func (this *APIClient) GetSessionDetails(wsid string) (*lib.Session, error)

GetSessionDetails requests the session details (keys) for a given session from the proxy. The proxy always sends its host public key, and if the session is anonymous, it also sends single-use user keys.

If a session requres a key, a client won't receive them here, he will have to use his own from ~/.ssh

func (*APIClient) GetSessionStats

func (this *APIClient) GetSessionStats(wsid string) (*lib.SessionStats, error)

func (*APIClient) POST

func (this *APIClient) POST(url string, contentType string, reader io.Reader) (*http.Response, error)

func (*APIClient) PublishSessionID

func (this *APIClient) PublishSessionID(sid session.ID) error

func (*APIClient) RequestNewSession

func (this *APIClient) RequestNewSession(
	login string,
	secrets integration.InstanceSecrets,
	hostPort string, fport *client.ForwardedPort) (*lib.Session, error)

RequestNewSession makes an HTTP call to a Telecast server, passing the SSH secrets of the local session.

The server will create a disposable SSH proxy pre-configured to trust this instance

type App

type App struct {
	// CLI arguments
	Args []string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(fs *flag.FlagSet) (*App, error)

NewApp constructs and returns a "Teleconsole application object" initialized with the command line arguments, values from the configuration file, ready to run

func (*App) DebugDump

func (this *App) DebugDump()

func (*App) GetConfig

func (this *App) GetConfig() *conf.Config

func (*App) IsEndpointSpecified

func (this *App) IsEndpointSpecified() bool

IsEndpointSpecified returns 'true' if the server endpoint has been set either via -s flag, or via a config file

func (*App) Join

func (this *App) Join() error

func (*App) Start

func (this *App) Start() error

Start starts a new session. This is what happens by default when you launch teleconsole without parameters

func (*App) Usage

func (this *App) Usage()

type HTTPClientError

type HTTPClientError struct {
	StatusCode int
	Status     string
	Message    string
	// contains filtered or unexported fields
}

func (*HTTPClientError) Error

func (this *HTTPClientError) Error() string

Jump to

Keyboard shortcuts

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