appaccess

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

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 Setup

func Setup(t *testing.T) *Pack

Setup configures all clusters and servers needed for a test.

func SetupWithOptions

func SetupWithOptions(t *testing.T, opts AppTestOptions) *Pack

SetupWithOptions configures app access test with custom options.

func (*Pack) CreateAppSession

func (p *Pack) CreateAppSession(t *testing.T, publicAddr, clusterName string) []*http.Cookie

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

func (p *Pack) CreateUser(t *testing.T) (types.User, string)

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 (p *Pack) LeafAppClusterName() string

func (*Pack) LeafAppName

func (p *Pack) LeafAppName() string

func (*Pack) LeafAppPublicAddr

func (p *Pack) LeafAppPublicAddr() string

func (*Pack) LockUser

func (p *Pack) LockUser(t *testing.T)

LockUser will lock the configured user for this pack.

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.

func (*Pack) MakeTeleportClient

func (p *Pack) MakeTeleportClient(t *testing.T, user string) *client.TeleportClient

func (*Pack) RootAppClusterName

func (p *Pack) RootAppClusterName() string

func (*Pack) RootAppName

func (p *Pack) RootAppName() string

func (*Pack) RootAppPublicAddr

func (p *Pack) RootAppPublicAddr() string

func (*Pack) RootWebAddr

func (p *Pack) RootWebAddr() string

Jump to

Keyboard shortcuts

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