testkit

package
v0.0.0-...-baf11bc Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSAKeySize = 2048
	RSAKey     = "rsa2048"
)

Variables

This section is empty.

Functions

func CheckCertificateChainOrder

func CheckCertificateChainOrder(t *testing.T, chain string)

Certificate chain starts from leaf certificate and ends with a root certificate (https://tools.ietf.org/html/rfc5246#section-7.4.2). The correct certificate chain holds the following property: ith certificate in the chain is issued by (i+1)th certificate

func CheckIfCertIsSigned

func CheckIfCertIsSigned(t *testing.T, clientCertStr, caCertStr string)

func CheckIfChainContainsTwoCertificates

func CheckIfChainContainsTwoCertificates(t *testing.T, certChain string)

func CheckIfSubjectEquals

func CheckIfSubjectEquals(t *testing.T, expectedSubject, certificateStr string)

func CreateCsr

func CreateCsr(strSubject string, keys *rsa.PrivateKey) (string, error)

func CreateKey

func CreateKey(t *testing.T) *rsa.PrivateKey

func DecodeCertChain

func DecodeCertChain(t *testing.T, certificateChain string) []*x509.Certificate

func GenerateKey

func GenerateKey() (*rsa.PrivateKey, error)

func GetCertificateHash

func GetCertificateHash(t *testing.T, certificateStr string) string

func ParseSubject

func ParseSubject(subject string) pkix.Name

func WaitForFunction

func WaitForFunction(interval time.Duration, timeout time.Duration, isReady func() bool) error

Types

type ConfigmapCleaner

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

func NewConfigMapCleaner

func NewConfigMapCleaner(configListManager Manager, configMapName string) *ConfigmapCleaner

func (*ConfigmapCleaner) CleanRevocationList

func (c *ConfigmapCleaner) CleanRevocationList(hash string) error

type Manager

type Manager interface {
	Get(name string, options metav1.GetOptions) (*v1.ConfigMap, error)
	Update(configmap *v1.ConfigMap) (*v1.ConfigMap, error)
}

type TestConfig

type TestConfig struct {
	ExternalConnectorURL         string `envconfig:"default=http://compass-connector:3000/graphql"`
	InternalConnectorURL         string `envconfig:"default=http://compass-connector:3001/graphql"`
	HydratorURL                  string `envconfig:"default=http://compass-connector:8080"`
	ConnectorURL                 string
	CertificateDataHeader        string `envconfig:"default=Certificate-Data"`
	RevocationConfigMapName      string `envconfig:"default=revocations-config"`
	RevocationConfigMapNamespace string `envconfig:"default=compass-system"`
}

func ReadConfig

func ReadConfig() (TestConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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