testkit

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCSR

func CreateCSR(subjectRaw string, key *rsa.PrivateKey) ([]byte, error)

func CreateKey

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

Types

type API

type API struct {
	TargetUrl        string          `json:"targetUrl"`
	Credentials      *Credentials    `json:"credentials,omitempty"`
	Spec             json.RawMessage `json:"spec,omitempty"`
	SpecificationUrl string          `json:"specificationUrl,omitempty"`
	ApiType          string          `json:"apiType"`
}

type ApiInfo

type ApiInfo struct {
	*RuntimeURLs
	ManagementInfoURL string `json:"infoUrl"`
	CertificatesUrl   string `json:"certificatesUrl"`
}

type Basic

type Basic struct {
	Username string    `json:"username"`
	Password string    `json:"password"`
	CSRFInfo *CSRFInfo `json:"csrfInfo,omitempty"`
}

type CSRFInfo

type CSRFInfo struct {
	TokenEndpointURL string `json:"tokenEndpointURL"`
}

type CertInfo

type CertInfo struct {
	Subject      string `json:"subject"`
	Extensions   string `json:"extensions"`
	KeyAlgorithm string `json:"key-algorithm"`
}

type CertificateGen

type CertificateGen struct {
	CommonName  string    `json:"commonName"`
	Certificate string    `json:"certificate"`
	CSRFInfo    *CSRFInfo `json:"csrfInfo,omitempty"`
}

type CompassClients

type CompassClients struct {
	DirectorClient  *CompassDirectorClient
	ConnectorClient *CompassConnectorClient
}

func InitCompassClients

func InitCompassClients(kymaClients KymaClients, state CompassDirectorClientState, domain string, skipSSLVerify bool) CompassClients

type CompassConnectorClient

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

func NewCompassConnectorClient

func NewCompassConnectorClient(skipTLSVerify bool) *CompassConnectorClient

func (*CompassConnectorClient) GenerateCertificateForToken

func (cc *CompassConnectorClient) GenerateCertificateForToken(token, connectorURL string) (tls.Certificate, error)

type CompassDirectorClient

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

func NewCompassDirectorClientOrDie

func NewCompassDirectorClientOrDie(coreClient *kubernetes.Clientset, state CompassDirectorClientState, domain string) *CompassDirectorClient

func (*CompassDirectorClient) GetOneTimeTokenForApplication

func (dc *CompassDirectorClient) GetOneTimeTokenForApplication(applicationID string) (graphql.OneTimeTokenExt, error)

func (*CompassDirectorClient) RegisterApplication

func (*CompassDirectorClient) UnregisterApplication

func (dc *CompassDirectorClient) UnregisterApplication(id string) (graphql.ApplicationExt, error)

type CompassDirectorClientState

type CompassDirectorClientState interface {
	GetScenariosLabelKey() string
	GetDefaultTenant() string
	GetRuntimeID() string
	GetDexSecret() (string, string)
}

type ConnectorClient

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

func NewConnectorClient

func NewConnectorClient(appName string, tokenRequests connectionTokenHandlerClient.TokenRequestInterface, httpClient *http.Client, logger logrus.FieldLogger) *ConnectorClient

func (*ConnectorClient) GetCertificate

func (cc *ConnectorClient) GetCertificate(url string, csr []byte) ([]*x509.Certificate, error)

func (*ConnectorClient) GetInfo

func (cc *ConnectorClient) GetInfo(url string) (*InfoResponse, error)

func (*ConnectorClient) GetToken

func (cc *ConnectorClient) GetToken(tenant, group string) (string, error)

type Credentials

type Credentials struct {
	Oauth          *Oauth          `json:"oauth,omitempty"`
	Basic          *Basic          `json:"basic,omitempty"`
	CertificateGen *CertificateGen `json:"certificateGen,omitempty"`
}

type CrtResponse

type CrtResponse struct {
	CRTChain  string `json:"crt"`
	ClientCRT string `json:"clientCrt"`
	CaCRT     string `json:"caCrt"`
}

type CsrRequest

type CsrRequest struct {
	Csr string `json:"csr"`
}

type DocsObject

type DocsObject struct {
	Title  string `json:"title"`
	Type   string `json:"type"`
	Source string `json:"source"`
}

type Documentation

type Documentation struct {
	DisplayName string       `json:"displayName"`
	Description string       `json:"description"`
	Type        string       `json:"type"`
	Tags        []string     `json:"tags,omitempty"`
	Docs        []DocsObject `json:"docs,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Code     int    `json:"code"`
	ErrorMsg string `json:"error"`
}

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type EventSender

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

func NewEventSender

func NewEventSender(httpClient resilient.HttpClient, domain string, ceClient http2.ResilientCloudEventClient) *EventSender

func (*EventSender) SendCloudEventToMesh

func (s *EventSender) SendCloudEventToMesh(ctx context.Context, event cloudevents.Event) (ct context.Context, evt *cloudevents.Event, err error)

func (*EventSender) SendEvent

func (s *EventSender) SendEvent(appName string, event *ExampleEvent) error

type Events

type Events struct {
	Spec json.RawMessage `json:"spec,omitempty"`
}

type ExampleEvent

type ExampleEvent struct {
	EventType        string    `json:"event-type"`
	EventTypeVersion string    `json:"event-type-version"`
	EventID          string    `json:"event-id"`
	EventTime        time.Time `json:"event-time"`
	Data             string    `json:"data"`
}

type InfoResponse

type InfoResponse struct {
	CertUrl     string   `json:"csrUrl"`
	Api         ApiInfo  `json:"api"`
	Certificate CertInfo `json:"certificate"`
}

type KymaClients

type KymaClients struct {
	AppOperatorClientset         *appOperatorClient.Clientset
	AppBrokerClientset           *appBrokerClient.Clientset
	KubelessClientset            *kubeless.Clientset
	CoreClientset                *coreClient.Clientset
	Pods                         v1.PodInterface
	EventingClientset            *eventingClient.Clientset
	ServiceCatalogClientset      *serviceCatalogClient.Clientset
	ServiceBindingUsageClientset *serviceBindingUsageClient.Clientset
	GatewayClientset             *gatewayClient.Clientset
}

func InitKymaClients

func InitKymaClients(config *rest.Config, testID string) KymaClients

type Oauth

type Oauth struct {
	URL          string    `json:"url"`
	ClientID     string    `json:"clientId"`
	ClientSecret string    `json:"clientSecret"`
	CSRFInfo     *CSRFInfo `json:"csrfInfo,omitempty"`
}

type RegisterServiceResponse

type RegisterServiceResponse struct {
	ID string `json:"id"`
}

type RegistryClient

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

func NewRegistryClient

func NewRegistryClient(url string, httpClient resilient.HttpClient) *RegistryClient

func (*RegistryClient) DeleteService

func (rc *RegistryClient) DeleteService(id string) error

func (*RegistryClient) GetService

func (rc *RegistryClient) GetService(id string) (*ServiceDetails, error)

func (*RegistryClient) RegisterService

func (rc *RegistryClient) RegisterService(service *ServiceDetails) (string, error)

type RuntimeURLs

type RuntimeURLs struct {
	MetadataUrl string `json:"metadataUrl"`
	EventsUrl   string `json:"eventsUrl"`
}

type ServiceDetails

type ServiceDetails struct {
	Provider         string            `json:"provider"`
	Name             string            `json:"name"`
	Description      string            `json:"description"`
	ShortDescription string            `json:"shortDescription,omitempty"`
	Identifier       string            `json:"identifier,omitempty"`
	Labels           map[string]string `json:"labels,omitempty"`
	Api              *API              `json:"api,omitempty"`
	Events           *Events           `json:"events,omitempty"`
	Documentation    *Documentation    `json:"documentation,omitempty"`
}

type TestService

type TestService struct {
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewTestService

func NewTestService(httpClient *http.Client, deployments appsClient.DeploymentInterface, services coreClient.ServiceInterface, apis gatewayClient.ApiInterface, domain, namespace string) *TestService

func (*TestService) CreateTestService

func (ts *TestService) CreateTestService() error

func (*TestService) DeleteTestService

func (ts *TestService) DeleteTestService() error

func (*TestService) GetInClusterTestServiceURL

func (ts *TestService) GetInClusterTestServiceURL() string

func (*TestService) GetTestServiceURL

func (ts *TestService) GetTestServiceURL() string

func (*TestService) IsReady

func (ts *TestService) IsReady() error

func (*TestService) WaitForCounterPodToUpdateValue

func (ts *TestService) WaitForCounterPodToUpdateValue(val int) error

Jump to

Keyboard shortcuts

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