Documentation ¶
Overview ¶
integration package tests Teleport on a high level creating clusters of servers in memory, connecting them together and connecting to them
Index ¶
- func SetTestTimeouts(ms int)
- type InstanceSecrets
- type TeleInstance
- func (this *TeleInstance) AddUser(username string, mappings []string)
- func (this *TeleInstance) Create(trustedSecrets []*InstanceSecrets, enableSSH bool, console io.Writer) error
- func (this *TeleInstance) GetPortAuth() string
- func (this *TeleInstance) GetPortProxy() string
- func (this *TeleInstance) GetPortSSH() string
- func (this *TeleInstance) GetPortSSHInt() int
- func (this *TeleInstance) GetPortWeb() string
- func (this *TeleInstance) NewClient(login string, site string, host string, port int) (tc *client.TeleportClient, err error)
- func (this *TeleInstance) Start() (err error)
- func (this *TeleInstance) Stop() error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetTestTimeouts ¶
func SetTestTimeouts(ms int)
SetTestTimeouts affects global timeouts inside Teleport, making connections work faster but consuming more CPU (useful for integration testing)
Types ¶
type InstanceSecrets ¶
type InstanceSecrets struct { // instance name (aka "site name") SiteName string `json:"site_name"` // instance keys+cert (reused for hostCA and userCA) PubKey []byte `json:"pub"` PrivKey []byte `json:"priv"` Cert []byte `json:"cert"` // ListenPort is a reverse tunnel listening port, allowing // other sites to connect to this instance. Set to empty // string if this instance is not allowing incoming tunnels ListenAddr string `json:"tunnel_addr"` // list of users this instance trusts (key in the map is username) Users map[string]*User }
func (*InstanceSecrets) AllowedLogins ¶
func (this *InstanceSecrets) AllowedLogins() []string
func (*InstanceSecrets) AsSlice ¶
func (this *InstanceSecrets) AsSlice() []*InstanceSecrets
func (*InstanceSecrets) GetCAs ¶
func (this *InstanceSecrets) GetCAs() []services.CertAuthority
GetCAs return an array of CAs stored by the secrets object. In this case we always return hard-coded userCA + hostCA (and they share keys for simplicity)
func (*InstanceSecrets) GetIdentity ¶
func (this *InstanceSecrets) GetIdentity() *auth.Identity
func (*InstanceSecrets) String ¶
func (s *InstanceSecrets) String() string
type TeleInstance ¶
type TeleInstance struct { // Secrets holds the keys (pub, priv and derived cert) of this instance Secrets InstanceSecrets // Slice of TCP ports used by Teleport services Ports []int // Hostname is the name of the host where this isnstance is running Hostname string // Internal stuff... Process *service.TeleportProcess Config *service.Config Tunnel reversetunnel.Server }
TeleInstance represents an in-memory instance of a teleport process for testing
func NewInstance ¶
func NewInstance(siteName string, hostName string, ports []int, priv, pub []byte) *TeleInstance
NewInstance creates a new Teleport process instance
func (*TeleInstance) AddUser ¶
func (this *TeleInstance) AddUser(username string, mappings []string)
Adds a new user into this Teleport instance. 'mappings' is a comma-separated list of OS users
func (*TeleInstance) Create ¶
func (this *TeleInstance) Create(trustedSecrets []*InstanceSecrets, enableSSH bool, console io.Writer) error
Create creates a new instance of Teleport which trusts a lsit of other clusters (other instances)
func (*TeleInstance) GetPortAuth ¶
func (this *TeleInstance) GetPortAuth() string
func (*TeleInstance) GetPortProxy ¶
func (this *TeleInstance) GetPortProxy() string
func (*TeleInstance) GetPortSSH ¶
func (this *TeleInstance) GetPortSSH() string
func (*TeleInstance) GetPortSSHInt ¶
func (this *TeleInstance) GetPortSSHInt() int
func (*TeleInstance) GetPortWeb ¶
func (this *TeleInstance) GetPortWeb() string
func (*TeleInstance) NewClient ¶
func (this *TeleInstance) NewClient(login string, site string, host string, port int) (tc *client.TeleportClient, err error)
NewClient returns a fully configured client (with server CAs and user keys)
func (*TeleInstance) Start ¶
func (this *TeleInstance) Start() (err error)
func (*TeleInstance) Stop ¶
func (this *TeleInstance) Stop() error