coderdenttest

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Keys = map[string]ed25519.PublicKey{}
)

Functions

func AddFullLicense

func AddFullLicense(t *testing.T, client *codersdk.Client) codersdk.License

AddFullLicense generates a license with all features enabled.

func AddLicense

func AddLicense(t *testing.T, client *codersdk.Client, options LicenseOptions) codersdk.License

AddLicense generates a new license with the options provided and inserts it.

func GenerateLicense

func GenerateLicense(t *testing.T, options LicenseOptions) string

GenerateLicense returns a signed JWT using the test key.

func New

New constructs a codersdk client connected to an in-memory Enterprise API instance.

func NewWorkspaceProxy

func NewWorkspaceProxy(t *testing.T, coderdAPI *coderd.API, owner *codersdk.Client, options *ProxyOptions) *wsproxy.Server

NewWorkspaceProxy will configure a wsproxy.Server with the given options. The new wsproxy will register itself with the given coderd.API instance. The first user owner client is required to create the wsproxy on the coderd api server.

Types

type LicenseOptions

type LicenseOptions struct {
	AccountType string
	AccountID   string
	Trial       bool
	AllFeatures bool
	GraceAt     time.Time
	ExpiresAt   time.Time
	Features    license.Features
}

type Options

type Options struct {
	*coderdtest.Options
	AuditLogging                bool
	BrowserOnly                 bool
	EntitlementsUpdateInterval  time.Duration
	SCIMAPIKey                  []byte
	UserWorkspaceQuota          int
	ProxyHealthInterval         time.Duration
	LicenseOptions              *LicenseOptions
	NoDefaultQuietHoursSchedule bool
	DontAddLicense              bool
	DontAddFirstUser            bool
	ReplicaSyncUpdateInterval   time.Duration
	ExternalTokenEncryption     []dbcrypt.Cipher
	ProvisionerDaemonPSK        string
}

type ProxyOptions

type ProxyOptions struct {
	Name        string
	Experiments codersdk.Experiments

	TLSCertificates []tls.Certificate
	AppHostname     string
	DisablePathApps bool
	DerpDisabled    bool
	DerpOnly        bool

	// ProxyURL is optional
	ProxyURL *url.URL
}

Jump to

Keyboard shortcuts

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