Documentation ¶
Index ¶
- type AppTestOptions
- type Pack
- func (p *Pack) CreateAppSession(t *testing.T, publicAddr, clusterName string) []*http.Cookie
- func (p *Pack) CreateAppSessionWithClientCert(t *testing.T) []tls.Certificate
- func (p *Pack) CreateUser(t *testing.T) (types.User, string)
- func (p *Pack) GenerateAndSetupUserCreds(t *testing.T, tc *client.TeleportClient, ttl time.Duration)
- func (p *Pack) LeafAppClusterName() string
- func (p *Pack) LeafAppName() string
- func (p *Pack) LeafAppPublicAddr() string
- func (p *Pack) LockUser(t *testing.T)
- func (p *Pack) MakeRequest(cookies []*http.Cookie, method string, endpoint string, ...) (int, string, error)
- func (p *Pack) MakeTeleportClient(t *testing.T, user string) *client.TeleportClient
- func (p *Pack) RootAppClusterName() string
- func (p *Pack) RootAppName() string
- func (p *Pack) RootAppPublicAddr() string
- func (p *Pack) RootWebAddr() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppTestOptions ¶
type AppTestOptions struct { ExtraRootApps []servicecfg.App ExtraLeafApps []servicecfg.App RootClusterListeners helpers.InstanceListenerSetupFunc LeafClusterListeners helpers.InstanceListenerSetupFunc Clock clockwork.FakeClock MonitorCloseChannel chan struct{} RootConfig func(config *servicecfg.Config) LeafConfig func(config *servicecfg.Config) }
type Pack ¶
type Pack struct {
// contains filtered or unexported fields
}
Pack contains identity as well as initialized Teleport clusters and instances.
func SetupWithOptions ¶
func SetupWithOptions(t *testing.T, opts AppTestOptions) *Pack
SetupWithOptions configures app access test with custom options.
func (*Pack) CreateAppSession ¶
CreateAppSession creates an application session with the root cluster. The application that the user connects to may be running in a leaf cluster.
func (*Pack) CreateAppSessionWithClientCert ¶
func (p *Pack) CreateAppSessionWithClientCert(t *testing.T) []tls.Certificate
CreateAppSessionWithClientCert creates an application session with the root cluster and returns the client cert that can be used for an application request.
func (*Pack) CreateUser ¶
CreateUser creates and upserts a new user into the root cluster, and returns the new user and password.
func (*Pack) GenerateAndSetupUserCreds ¶
func (p *Pack) GenerateAndSetupUserCreds(t *testing.T, tc *client.TeleportClient, ttl time.Duration)
GenerateAndSetupUserCreds is useful in situations where we need to manually manipulate user certs, for example when we want to force a TeleportClient to operate using expired certs.
ttl equals to 0 means that the certs will have the default TTL used by helpers.GenerateUserCreds.
func (*Pack) LeafAppClusterName ¶
func (*Pack) LeafAppName ¶
func (*Pack) LeafAppPublicAddr ¶
func (*Pack) MakeRequest ¶
func (p *Pack) MakeRequest(cookies []*http.Cookie, method string, endpoint string, headers ...servicecfg.Header) (int, string, error)
MakeRequest makes a request to the root cluster with the given session cookie.