Documentation ¶
Index ¶
- Constants
- func GetFreePorts(n int) (ports []int, err error)
- func ParseForwardAddr(spec string) (p *client.ForwardedPort, err error)
- func ReplaceHost(hostPort, newHost string) string
- type GithubError
- type GithubKey
- type Identity
- type IniConfig
- type Party
- type ServerVersion
- type Session
- type SessionStats
- type UserMap
Constants ¶
const ( TrimChars = "\"'" CommentChar = ";" )
const (
ClientVersionHeader = "X-Client-Version"
)
Variables ¶
This section is empty.
Functions ¶
func GetFreePorts ¶
findFreePortRange returns a slice of n available IP ports
func ParseForwardAddr ¶
func ParseForwardAddr(spec string) (p *client.ForwardedPort, err error)
ParseForwardAddr takes a host:port spec and returns a pre-configured "ForwardedPort" structure. It understands the following spec:
"5000" -> localhost:5000 "host:port" -> host:port "http://host" -> host:80
func ReplaceHost ¶
replaceHost takes a host:port string (with optional port), replaces host with 'newHost' and returns the result
Types ¶
type GithubError ¶
type GithubError struct {
Message string `json:"message"`
}
func (GithubError) Error ¶
func (this GithubError) Error() string
type Identity ¶
type Identity struct { Anonymous bool `json:"anonymous"` // username here indicates the local OS user name Username string `json:"username"` // an identity may have multiple SSH keys, for example Github allows // you to have several. also, a user can specify multiple SSH identities // for a single session, they all go here: Logins []sshLogin `json:"logins"` }
Identity defines a user/account of Teleconsole. There are two types of identities:
Anonymous identity maps to a local OS user and uses one-time auto-generated SSH pair of keys (priv/pub). By default an anonymous identity is submitted to the proxy server along with a single-use session.
A joining party receives pub/priv keypair of the anonymous identity and logs in using it.
- A named identity uses a user-supplied SSH key, either via github handle or as a file (like ~/.ssh/id_rsa). Named identities private key never leaves the machine, but the joining party is supposed to have a private key on their machine to be able to join.
func MakeIdentity ¶
MakeIdentity creates a new identity from an identity source. If the source is an empty string, an anonymous identity is created.
Otherwise a regular (named) identity is created. A source can be a comma-separated list of values, where each value can be either a file, or a github handle
Examples:
MakeIdentity("filename") MakeIdentity('"/home/my name/.ssh/id_rsa",githubuser')
func MakeIdentityFromFile ¶
func (*Identity) AnnounceUsers ¶
AnnounceUsers returns a list of Teleport users to be sent along with a new Teleconsole session. Anonymous identities send private keys too, while regular identities do not send their private keys.
func (*Identity) LoginUsers ¶
LoginUsers returns Teleport users suitable for logging into a locally running Teleport instance. Public and private keys are returned.
func (*Identity) PrivateKeyFor ¶
type IniConfig ¶
type IniConfig struct {
// contains filtered or unexported fields
}
IniConfig type stores all values found in a ini-file
func ParseIniFile ¶
ParseIniFile reads the supplied ini-file and returns a IniConf structure Later you can use IniConf.Get("section", "name") to get config values
func (*IniConfig) GetOrDefault ¶
func (*IniConfig) GetSectionNames ¶
func (conf *IniConfig) GetSectionNames() (names sort.StringSlice)
type ServerVersion ¶
type ServerVersion struct { // server's version & build data ServerVersion string `json:"server_ver"` // clients must show this warning message to users if it's not empty WarningMsg string `json:"warn_msg"` }
ServerVersion is a JSON response returned by the server at the behinning of API conversation
type Session ¶
type Session struct { // web session ID (not the same as teleport session ID) ID string `json:"id"` // teleport session ID TSID string `json:"teleport_session_id"` // Secretes and Login are needed to join this session Secrets integration.InstanceSecrets `json:"secrets"` Login string `json:"login"` // ProxyHostPort is the host:port of the SSH proxy dynamically // created for this session ProxyHostPort string `json:"proxy_addr"` // NodeHostPort is the host:port of the client machine which // initiated the Teleconsole NodeHostPort string `json:"node_addr"` // Forwarded ports: these are set via -f flag on the client // when it creates a new session ForwardedPort *client.ForwardedPort `json:"forwarded_port"` }
Session travels in JSON format between teleconsole client/server
func (*Session) GetNodeHostPort ¶
type SessionStats ¶
type UserMap ¶
type UserMap map[string]*integration.User