Versions in this module Expand all Collapse all v11 v11.3.3 Dec 13, 2022 Changes in this version + const Host + const HostID + const Loopback + const Site + func CloseAgent(teleAgent *teleagent.AgentServer, socketDirPath string) error + func CreateAgent(me *user.User, key *client.Key) (*teleagent.AgentServer, string, string, error) + func EnableDesktopService(config *service.Config) + func EnableKube(t *testing.T, config *service.Config, clusterName string) error + func EnableKubernetesService(t *testing.T, config *service.Config) + func ExternalSSHCommand(o CommandOptions) (*exec.Cmd, error) + func GetKubeClusters(t *testing.T, as *auth.Server) []types.KubeCluster + func GetLocalIP() (string, error) + func MakeProxyAddr(user, pass, host string) string + func MustCreateUserIdentityFile(t *testing.T, tc *TeleInstance, username string, ttl time.Duration) string + func MustGetCurrentUser(t *testing.T) *user.User + func NewListener(t *testing.T, ty service.ListenerType, fds *[]service.FileDescriptor) string + func NewListenerOn(t *testing.T, hostAddr string, ty service.ListenerType, ...) string + func Port(t *testing.T, addr string) int + func PortStr(t *testing.T, addr string) string + func SetTestTimeouts(t time.Duration) + func SetupUser(process *service.TeleportProcess, username string, roles []types.Role) error + func SetupUserCreds(tc *client.TeleportClient, proxyHost string, creds UserCreds) error + func SingleProxyPortSetupOn(addr string) func(*testing.T, *[]service.FileDescriptor) *InstanceListeners + func StandardListenerSetupOn(addr string) func(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func StartAndWait(process *service.TeleportProcess, expectedEvents []string) ([]service.Event, error) + func TestMainImplementation(m *testing.M) + func TryCreateTrustedCluster(t *testing.T, authServer *auth.Server, trustedCluster types.TrustedCluster) + func WaitForActiveTunnelConnections(t *testing.T, tunnel reversetunnel.Server, clusterName string, ...) + func WaitForAuditEventTypeWithBackoff(t *testing.T, cli *auth.Server, startTime time.Time, eventType string) []apievents.AuditEvent + func WaitForClusters(tun reversetunnel.Server, expected int) func() bool + func WaitForNodeCount(ctx context.Context, t *TeleInstance, clusterName string, count int) error + func WaitForProxyCount(t *TeleInstance, clusterName string, count int) error + func WaitForTunnelConnections(t *testing.T, authServer *auth.Server, clusterName string, expectedCount int) + type ClientConfig struct + Cluster string + EnableEscapeSequences bool + ForwardAgent bool + Host string + Interactive bool + JumpHost bool + Labels map[string]string + Login string + Port int + Proxy *ProxyConfig + SourceIP string + type CommandOptions struct + Command string + ControlPath string + ForcePTY bool + ForwardAgent bool + NodePort string + ProxyPort string + SocketPath string + type DisabledIMDSClient struct + func (d *DisabledIMDSClient) GetHostname(ctx context.Context) (string, error) + func (d *DisabledIMDSClient) GetID(ctx context.Context) (string, error) + func (d *DisabledIMDSClient) GetTags(ctx context.Context) (map[string]string, error) + func (d *DisabledIMDSClient) GetType() types.InstanceMetadataType + func (d *DisabledIMDSClient) IsAvailable(ctx context.Context) bool + type DiscardServer struct + func NewDiscardServer(host string, port int, hostSigner ssh.Signer) (*DiscardServer, error) + func (s *DiscardServer) HandleNewChan(_ context.Context, ccx *sshutils.ConnectionContext, newChannel ssh.NewChannel) + func (s *DiscardServer) Start() error + func (s *DiscardServer) Stop() + type Fixture struct + Log utils.Logger + Me *user.User + Priv []byte + Pub []byte + func NewFixture(t *testing.T) *Fixture + func (s *Fixture) DefaultInstanceConfig(t *testing.T) InstanceConfig + func (s *Fixture) NewTeleportInstance(t *testing.T) *TeleInstance + func (s *Fixture) NewTeleportWithConfig(t *testing.T, logins []string, instanceSecrets []*InstanceSecrets, ...) *TeleInstance + type InstanceConfig struct + Clock clockwork.Clock + ClusterName string + Fds []service.FileDescriptor + HostID string + Listeners *InstanceListeners + Log utils.Logger + NodeName string + Priv []byte + Pub []byte + type InstanceListenerSetupFunc func(*testing.T, *[]service.FileDescriptor) *InstanceListeners + type InstanceListeners struct + Auth string + IsSinglePortSetup bool + Mongo string + MySQL string + Postgres string + ReverseTunnel string + SSH string + SSHProxy string + Web string + func SeparateMongoAndPostgresPortSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func SeparateMongoPortSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func SeparatePostgresPortSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func SingleProxyPortSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func StandardListenerSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + func WebReverseTunnelMuxPortSetup(t *testing.T, fds *[]service.FileDescriptor) *InstanceListeners + type InstanceSecrets struct + Cert []byte + PrivKey []byte + PubKey []byte + SiteName string + TLSCACert []byte + TLSCert []byte + TunnelAddr string + Users map[string]*User + func (s *InstanceSecrets) AllowedLogins() []string + func (s *InstanceSecrets) AsSlice() []*InstanceSecrets + func (s *InstanceSecrets) GetCAs() ([]types.CertAuthority, error) + func (s *InstanceSecrets) GetIdentity() *auth.Identity + func (s *InstanceSecrets) GetRoles(t *testing.T) []types.Role + func (s *InstanceSecrets) String() string + type ProxyAuthorizer struct + func NewProxyAuthorizer(handler http.Handler, user, pass string) *ProxyAuthorizer + func (p *ProxyAuthorizer) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (p *ProxyAuthorizer) SetCredentials(user, pass string) + func (p *ProxyAuthorizer) WaitForRequest(timeout time.Duration) error + type ProxyConfig struct + DisableALPNSNIListener bool + DisableWebInterface bool + DisableWebService bool + FileDescriptors []service.FileDescriptor + Name string + ReverseTunnelAddr string + SSHAddr string + WebAddr string + type ProxyHandler struct + func (p *ProxyHandler) Count() int + func (p *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type TeleInstance struct + Config *service.Config + Fds []service.FileDescriptor + Hostname string + Log utils.Logger + Nodes []*service.TeleportProcess + Process *service.TeleportProcess + RemoteClusterWatcher *reversetunnel.RemoteClusterTunnelManager + Secrets InstanceSecrets + Tunnel reversetunnel.Server + UploadEventsC chan events.UploadEvent + func NewInstance(t *testing.T, cfg InstanceConfig) *TeleInstance + func (i *TeleInstance) AddClientCredentials(tc *client.TeleportClient, cfg ClientConfig) (*client.TeleportClient, error) + func (i *TeleInstance) AddUser(username string, mappings []string) *User + func (i *TeleInstance) AddUserWithRole(username string, roles ...types.Role) *User + func (i *TeleInstance) AsTrustedCluster(token string, roleMap types.RoleMap) types.TrustedCluster + func (i *TeleInstance) Create(t *testing.T, trustedSecrets []*InstanceSecrets, enableSSH bool, ...) error + func (i *TeleInstance) CreateEx(t *testing.T, trustedSecrets []*InstanceSecrets, tconf *service.Config) error + func (i *TeleInstance) GenerateConfig(t *testing.T, trustedSecrets []*InstanceSecrets, tconf *service.Config) (*service.Config, error) + func (i *TeleInstance) GetSiteAPI(siteName string) auth.ClientI + func (i *TeleInstance) NewClient(cfg ClientConfig) (*client.TeleportClient, error) + func (i *TeleInstance) NewClientWithCreds(cfg ClientConfig, creds UserCreds) (tc *client.TeleportClient, err error) + func (i *TeleInstance) NewUnauthenticatedClient(cfg ClientConfig) (tc *client.TeleportClient, err error) + func (i *TeleInstance) Reset() (err error) + func (i *TeleInstance) Start() error + func (i *TeleInstance) StartApp(conf *service.Config) (*service.TeleportProcess, error) + func (i *TeleInstance) StartApps(configs []*service.Config) ([]*service.TeleportProcess, error) + func (i *TeleInstance) StartDatabase(conf *service.Config) (*service.TeleportProcess, *auth.Client, error) + func (i *TeleInstance) StartKube(t *testing.T, conf *service.Config, clusterName string) (*service.TeleportProcess, error) + func (i *TeleInstance) StartNode(tconf *service.Config) (*service.TeleportProcess, error) + func (i *TeleInstance) StartNodeAndProxy(t *testing.T, name string) (sshPort, webProxyPort, sshProxyPort int) + func (i *TeleInstance) StartNodeWithTargetPort(tconf *service.Config, authPort string) (*service.TeleportProcess, error) + func (i *TeleInstance) StartProxy(cfg ProxyConfig) (reversetunnel.Server, *service.TeleportProcess, error) + func (i *TeleInstance) StartReverseTunnelNode(tconf *service.Config) (*service.TeleportProcess, error) + func (i *TeleInstance) StopAll() error + func (i *TeleInstance) StopAuth(removeData bool) error + func (i *TeleInstance) StopNodes() error + func (i *TeleInstance) StopProxy() error + type User struct + AllowedLogins []string + Key *client.Key + Roles []types.Role + Username string + type UserCreds struct + HostCA types.CertAuthority + Key client.Key + func GenerateUserCreds(req UserCredsRequest) (*UserCreds, error) + type UserCredsRequest struct + Process *service.TeleportProcess + RouteToCluster string + SourceIP string + TTL time.Duration + Username string