framework

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 58 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootUserId = "root@e2e.f110.dev"
)

Variables

This section is empty.

Functions

func WithLatestVault added in v0.15.0

func WithLatestVault(p *Proxy)

func WithVaultV110 added in v0.15.0

func WithVaultV110(p *Proxy)

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func (*Agent) FollowRedirect added in v0.10.0

func (a *Agent) FollowRedirect(m *btesting.Matcher) error

func (*Agent) Get

func (a *Agent) Get(m *btesting.Matcher, u string) bool

func (*Agent) ParseLastResponseBody added in v0.10.0

func (a *Agent) ParseLastResponseBody(in interface{}) error

func (*Agent) Post added in v0.10.0

func (a *Agent) Post(m *btesting.Matcher, u, body string) bool

func (*Agent) SaveCookie added in v0.10.0

func (a *Agent) SaveCookie()

func (*Agent) Tunnel added in v0.12.0

func (a *Agent) Tunnel(m *btesting.Matcher) *Tunnel

type Agents

type Agents struct {
	// contains filtered or unexported fields
}

func NewAgents

func NewAgents(
	domain string,
	ca *x509.Certificate,
	sessionStore *session.SecureCookieStore,
	rpcPort int,
	signPrivateKey *ecdsa.PrivateKey,
) *Agents

func (*Agents) Authorized

func (a *Agents) Authorized(id string) *Agent

Authorized returns the agent for authorized user. This agent uses the cookie secret.

func (*Agents) DecodeCookieValue added in v0.10.0

func (a *Agents) DecodeCookieValue(name, value string) (*session.Session, error)

func (*Agents) RPCClient added in v0.12.0

func (a *Agents) RPCClient(id string) *rpcclient.ClientWithUserToken

func (*Agents) Unauthorized

func (a *Agents) Unauthorized() *Agent

func (*Agents) User added in v0.10.0

func (a *Agents) User(id string) *Agent

User returns the agent for user. This agent is not authorized initially. If called by same id, then returns the same agent. User is caching the agent, Authorized creates the agent by each call.

type AuthResponse added in v0.10.0

type AuthResponse struct {
	Email    string `json:",omitempty"`
	Query    string
	LoginURL string
}

type Connector added in v0.11.0

type Connector struct {
	// contains filtered or unexported fields
}

func NewConnector added in v0.11.0

func NewConnector(name string, m *btesting.MockServer, proxyCACert *x509.Certificate) (*Connector, error)

func (*Connector) Start added in v0.11.0

func (c *Connector) Start(client *rpcclient.ClientWithUserToken, host, serverName string) error

func (*Connector) Stop added in v0.11.0

func (c *Connector) Stop() error

type Framework

type Framework struct {
	*btesting.BehaviorDriven

	Proxy  *Proxy
	Agents *Agents
	DNS    *dns.Server
}

func New

func New(t *testing.T, cond ...ProxyCond) *Framework

func (*Framework) Execute

func (f *Framework) Execute()

type IdentityProvider

type IdentityProvider struct {
	*http.Server
	Issuer     string
	PrivateKey *rsa.PrivateKey
	// contains filtered or unexported fields
}

func NewIdentityProvider

func NewIdentityProvider(redirectURL string) (*IdentityProvider, error)

type Proxy

type Proxy struct {
	Domain     string
	DomainHost string
	CA         *x509.Certificate
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(t *testing.T, conds ...ProxyCond) (*Proxy, error)

func (*Proxy) Backend

func (p *Proxy) Backend(b *configv2.Backend)

func (*Proxy) Cleanup

func (p *Proxy) Cleanup() error

func (*Proxy) ClearConf added in v0.11.0

func (p *Proxy) ClearConf() bool

func (*Proxy) Connector added in v0.11.0

func (p *Proxy) Connector(name string, m *btesting.MockServer)

func (*Proxy) DashboardBackend added in v0.11.0

func (p *Proxy) DashboardBackend() *configv2.Backend

func (*Proxy) Host added in v0.12.0

func (p *Proxy) Host(name string) string

func (*Proxy) MockServer added in v0.11.0

func (p *Proxy) MockServer() *btesting.MockServer

func (*Proxy) MockTCPServer added in v0.12.0

func (p *Proxy) MockTCPServer() *btesting.MockTCPServer

func (*Proxy) ProxyAddr added in v0.12.0

func (p *Proxy) ProxyAddr() string

func (*Proxy) RPCPermission added in v0.11.0

func (p *Proxy) RPCPermission(v *configv2.RPCPermission)

func (*Proxy) Reload

func (p *Proxy) Reload() error

func (*Proxy) Role

func (p *Proxy) Role(r *configv2.Role)

func (*Proxy) URL added in v0.10.0

func (p *Proxy) URL(subdomain string, pathAnd ...string) string

func (*Proxy) User

func (p *Proxy) User(u *database.User)

type ProxyCond added in v0.12.0

type ProxyCond func(*Proxy)

type Tunnel added in v0.12.0

type Tunnel struct {
	Homedir string
	Buf     *bytes.Buffer
	// contains filtered or unexported fields
}

func NewTunnel added in v0.12.0

func NewTunnel(homedir string) *Tunnel

func (*Tunnel) CSR added in v0.12.0

func (t *Tunnel) CSR(m *btesting.Matcher) string

func (*Tunnel) GetFirstCertificate added in v0.12.0

func (t *Tunnel) GetFirstCertificate(m *btesting.Matcher, rpcClient *rpcclient.ClientWithUserToken) []byte

func (*Tunnel) Init added in v0.12.0

func (t *Tunnel) Init() bool

func (*Tunnel) LoadCert added in v0.12.0

func (t *Tunnel) LoadCert(c []byte) bool

func (*Tunnel) OpenURL added in v0.12.0

func (t *Tunnel) OpenURL(m *btesting.Matcher) bool

func (*Tunnel) OpeningURL added in v0.12.0

func (t *Tunnel) OpeningURL() string

func (*Tunnel) Proxy added in v0.12.0

func (t *Tunnel) Proxy(m *btesting.Matcher, host, resolver string, body io.Reader) bool

func (*Tunnel) Stop added in v0.12.0

func (t *Tunnel) Stop()

func (*Tunnel) WaitGettingToken added in v0.12.0

func (t *Tunnel) WaitGettingToken(timeout time.Duration) bool

Jump to

Keyboard shortcuts

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