testkit

package
v0.0.0-...-0e91422 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 23 Imported by: 1

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

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 HydratorClient

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

func NewHydratorClient

func NewHydratorClient(validatorURL string) *HydratorClient

func (*HydratorClient) ExecuteHydratorRequest

func (vc *HydratorClient) ExecuteHydratorRequest(t *testing.T, path string, headers map[string][]string) oathkeeper.AuthenticationSession

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 {
	Tenant               string `envconfig:"default=3e64ebae-38b5-46a0-b1ed-9ccee153a0ae"`
	ConnectorURL         string `envconfig:"default=http://compass-connector:3000/graphql"`
	DirectorURL          string `envconfig:"default=http://compass-director:3000/graphql"`
	ConnectorHydratorURL string `envconfig:"default=http://compass-connector:8080"`
	DirectorHydratorURL  string `envconfig:"default=http://compass-director:8080"`

	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