testing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCertificates

func DefaultCertificates() (*CertificateInfo, *CertificateInfo, *CertificateInfo)

DefaultCertificates returns an initially generated CA, server, and client certificate

func RandomString

func RandomString() string

func StringPtr added in v0.5.0

func StringPtr(val string) *string

Types

type Buffer

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

func (*Buffer) Reset

func (s *Buffer) Reset()

func (*Buffer) String

func (s *Buffer) String() string

func (*Buffer) Write

func (s *Buffer) Write(p []byte) (n int, err error)

type CertificateInfo

type CertificateInfo struct {
	Cert            *x509.Certificate
	CertBytes       []byte
	PrivateKey      *rsa.PrivateKey
	PrivateKeyBytes []byte
	X509            tls.Certificate
	// contains filtered or unexported fields
}

CertificateInfo wraps all of the information needed to describe a generated certificate

var (
	DefaultTestCA                *CertificateInfo
	DefaultTestServerCertificate *CertificateInfo
	DefaultTestClientCertificate *CertificateInfo
)

func GenerateSignedCertificate

func GenerateSignedCertificate(options GenerateCertificateOptions) (*CertificateInfo, error)

GenerateSignedCertificate generates a certificate with the given options

type GenerateCertificateOptions

type GenerateCertificateOptions struct {
	CA                 *CertificateInfo
	IsCA               bool
	ServiceName        string
	SPIFFEHostOverride string
	SPIFFEPathOverride string
	ExtraSANs          []string
	ExtraIPs           []net.IP
	Expiration         time.Time
	Bits               int
}

GenerateCertificateOptions describe how he want to generate a certificate

type TestClient added in v0.5.0

type TestClient struct {
	*api.Client
}

func NewTestClient added in v0.5.0

func NewTestClient(c *api.Client) *TestClient

func (*TestClient) Internal added in v0.5.0

func (c *TestClient) Internal() *api.Client

func (*TestClient) Token added in v0.5.0

func (c *TestClient) Token() string

func (*TestClient) Wait added in v0.5.0

func (c *TestClient) Wait(time.Duration) error

func (*TestClient) WatchServers added in v0.5.0

func (c *TestClient) WatchServers(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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