clients

package
v0.0.0-...-1eca41e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationHeader = "Application"
	GroupHeader       = "Group"
	TenantHeader      = "Tenant"
	Tenant            = "testkit-tenant"
	Extensions        = ""
	KeyAlgorithm      = "rsa2048"
)
View Source
const (
	TokenHeader = "Connector-Token"
)

Variables

This section is empty.

Functions

func GenerateApplicationCertificate

func GenerateApplicationCertificate(t *testing.T, client *CertSecuredGraphQLClient, connectorClient *TokenSecuredClient, appID string, clientKey *rsa.PrivateKey) (externalschema.CertificationResult, externalschema.Configuration)

func GetConfiguration

func GetConfiguration(t *testing.T, client *CertSecuredGraphQLClient, connectorClient *TokenSecuredClient, appID string) externalschema.Configuration

func NewHttpClient

func NewHttpClient(skipVerify bool) *http.Client

func NewIntegrationSystemClient

func NewIntegrationSystemClient(ctx context.Context, intSystemCredentials *directorSchema.IntSysSystemAuth) (*http.Client, error)

func NewK8SClientSet

func NewK8SClientSet(ctx context.Context, interval, pollingTimeout, timeout time.Duration) (*kubernetes.Clientset, error)

Types

type ApplicationResponse

type ApplicationResponse struct {
	Result schema.ApplicationExt `json:"result"`
}

type CertSecuredGraphQLClient

type CertSecuredGraphQLClient struct {
	CertSecuredGraphqlClient *gcli.Client
	// contains filtered or unexported fields
}

func NewCertSecuredGraphQLClient

func NewCertSecuredGraphQLClient(ctx context.Context, url, tenant string, key crypto.PrivateKey, certChain [][]byte, skipSSLValidation bool) (*CertSecuredGraphQLClient, error)

func (*CertSecuredGraphQLClient) GenerateApplicationToken

func (c *CertSecuredGraphQLClient) GenerateApplicationToken(t *testing.T, appID string) (externalschema.Token, error)

func (*CertSecuredGraphQLClient) GenerateRuntimeToken

func (c *CertSecuredGraphQLClient) GenerateRuntimeToken(t *testing.T, runtimeID string) (externalschema.Token, error)

type CertificateSecuredClient

type CertificateSecuredClient struct {
	GraphQlClient *gcli.Client
	// contains filtered or unexported fields
}

func NewCertificateSecuredConnectorClient

func NewCertificateSecuredConnectorClient(endpoint string, key *rsa.PrivateKey, certificates ...*x509.Certificate) *CertificateSecuredClient

func (*CertificateSecuredClient) Configuration

func (c *CertificateSecuredClient) Configuration(headers ...http.Header) (externalschema.Configuration, error)

func (*CertificateSecuredClient) RevokeCertificate

func (c *CertificateSecuredClient) RevokeCertificate() (bool, error)

func (*CertificateSecuredClient) SignCSR

type Client

type Client interface {
	CreateRuntime(in schema.RuntimeRegisterInput) (string, error)
	CleanupRuntime(runtimeID string) error
	SetRuntimeLabel(runtimeID, key, value string) error
	CreateApplication(in schema.ApplicationRegisterInput) (string, error)
	CleanupApplication(appID string) error
	SetApplicationLabel(applicationID, key, value string) error
	DeleteApplicationLabel(applicationID, key string) error
	SetDefaultEventing(runtimeID string, appID string, eventsBaseURL string) error
	GetOneTimeTokenUrl(appID string) (string, string, error)
}

func NewDirectorClient

func NewDirectorClient(gqlClient *graphql.Client, tenant, readyzURL string) (Client, error)

type ConnectorClient

type ConnectorClient interface {
	CreateToken(t *testing.T) model.TokenResponse
	GetInfo(t *testing.T, url string) (*model.InfoResponse, *model.Error)
	CreateCertChain(t *testing.T, csr, url string) (*model.CrtResponse, *model.Error)
}

func NewConnectorClient

func NewConnectorClient(directorClient Client, appID, tenant string, skipVerify bool) ConnectorClient

type Destination

type Destination struct {
	Name                 string                          `json:"Name"`
	Type                 string                          `json:"Type"`
	URL                  string                          `json:"URL"`
	Authentication       string                          `json:"Authentication"`
	AdditionalProperties DestinationAdditionalProperties `json:"additionalProperties"`
}

type DestinationAdditionalProperties

type DestinationAdditionalProperties struct {
	XCorrelationID    string `json:"correlationIds"` // from bundle // x-correlation-id"
	XSystemTenantID   string `json:"x-system-id"`    // local tenant id
	XSystemTenantName string `json:"x-system-name"`  // random or application name
	XSystemType       string `json:"x-system-type"`  // application type
}

type DestinationClient

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

func NewDestinationClient

func NewDestinationClient(instanceConfig config.InstanceConfig, apiConfig DestinationServiceAPIConfig) (*DestinationClient, error)

func (*DestinationClient) CreateDestinationInDestService

func (c *DestinationClient) CreateDestinationInDestService(t *testing.T, destination Destination, token string)

func (*DestinationClient) DeleteDestinationFromDestService

func (c *DestinationClient) DeleteDestinationFromDestService(t *testing.T, destinationName, token string)

func (*DestinationClient) FindDestinationByName

func (c *DestinationClient) FindDestinationByName(t *testing.T, serviceURL, destinationName, authToken, userTokenHeader string, expectedStatusCode int) json.RawMessage

func (*DestinationClient) GetDestinationCertificateByName

func (c *DestinationClient) GetDestinationCertificateByName(t *testing.T, serviceURL, certificateName, instanceID, token string, expectedStatusCode int) json.RawMessage

type DestinationServiceAPIConfig

type DestinationServiceAPIConfig struct {
	EndpointDestinationsFindAPI                          string        `envconfig:"APP_ENDPOINT_DESTINATIONS_FIND_API,default=/destination-configuration/local/v1/destinations"`
	EndpointTenantSubaccountLevelDestinations            string        `envconfig:"APP_ENDPOINT_TENANT_DESTINATIONS,default=/destination-configuration/v1/subaccountDestinations"`
	EndpointTenantSubaccountLevelDestinationCertificates string        `envconfig:"APP_ENDPOINT_TENANT_DESTINATION_CERTIFICATES,default=/destination-configuration/v1/subaccountCertificates"`
	EndpointTenantInstanceLevelDestinationCertificates   string        `` /* 130-byte string literal not displayed */
	Timeout                                              time.Duration `envconfig:"APP_DESTINATIONS_TIMEOUT,default=30s"`
	SkipSSLVerify                                        bool          `envconfig:"APP_DESTINATIONS_SKIP_SSL_VERIFY,default=false"`
	OAuthTokenPath                                       string        `envconfig:"APP_DESTINATION_OAUTH_TOKEN_PATH,default=/oauth/token"`
}

type DirectorClient

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

func (*DirectorClient) CleanupApplication

func (c *DirectorClient) CleanupApplication(appID string) error

func (*DirectorClient) CleanupRuntime

func (c *DirectorClient) CleanupRuntime(runtimeID string) error

func (*DirectorClient) CreateApplication

func (c *DirectorClient) CreateApplication(in schema.ApplicationRegisterInput) (string, error)

func (*DirectorClient) CreateRuntime

func (c *DirectorClient) CreateRuntime(in schema.RuntimeRegisterInput) (string, error)

func (*DirectorClient) DeleteApplicationLabel

func (c *DirectorClient) DeleteApplicationLabel(applicationID, key string) error

func (*DirectorClient) GetOneTimeTokenUrl

func (c *DirectorClient) GetOneTimeTokenUrl(appID string) (string, string, error)

func (*DirectorClient) SetApplicationLabel

func (c *DirectorClient) SetApplicationLabel(applicationID, key, value string) error

func (*DirectorClient) SetDefaultEventing

func (c *DirectorClient) SetDefaultEventing(runtimeID string, appID string, eventsBaseURL string) error

func (*DirectorClient) SetRuntimeLabel

func (c *DirectorClient) SetRuntimeLabel(runtimeID, key, value 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

func (*HydratorClient) ResolveCertificateData

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

func (*HydratorClient) ResolveToken

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

type OneTimeTokenResponse

type OneTimeTokenResponse struct {
	Result schema.OneTimeTokenForApplication `json:"result"`
}

type RuntimeResponse

type RuntimeResponse struct {
	Result schema.Runtime `json:"result"`
}

type SecuredClient

type SecuredClient interface {
	GetMgmInfo(t *testing.T, url string) (*testModel.ManagementInfoResponse, *testModel.Error)
	RenewCertificate(t *testing.T, url string, csr string) (*testModel.CrtResponse, *testModel.Error)
	RevokeCertificate(t *testing.T, url string) *testModel.Error

	ListServices(t *testing.T, url string) ([]model.Service, *testModel.Error)
	CreateService(t *testing.T, url string, service model.ServiceDetails) (*testModel.CreateServiceResponse, *testModel.Error)
	GetService(t *testing.T, url string, id string) (*model.ServiceDetails, *testModel.Error)
	UpdateService(t *testing.T, url string, id string, service model.ServiceDetails) (*model.ServiceDetails, *testModel.Error)
	DeleteService(t *testing.T, url string, id string) *testModel.Error
	CleanupService(t *testing.T, url string, id string) *testModel.Error
}

func NewSecuredClient

func NewSecuredClient(skipVerify bool, key *rsa.PrivateKey, certs []byte, tenant string) (SecuredClient, error)

type SetDefaultAppEventingResponse

type SetDefaultAppEventingResponse struct {
	Result schema.ApplicationEventingConfiguration `json:"result"`
}

type SetLabelResponse

type SetLabelResponse struct {
	Result schema.Label `json:"result"`
}

type TenantsResponse

type TenantsResponse struct {
	Result []*schema.Tenant
}

type TokenSecuredClient

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

func NewTokenSecuredClient

func NewTokenSecuredClient(endpoint string) *TokenSecuredClient

func (*TokenSecuredClient) Configuration

func (c *TokenSecuredClient) Configuration(token string, headers ...http.Header) (externalschema.Configuration, error)

func (*TokenSecuredClient) GenerateAndSignCert

func (*TokenSecuredClient) SignCSR

func (c *TokenSecuredClient) SignCSR(csr string, token string, headers ...http.Header) (externalschema.CertificationResult, error)

Jump to

Keyboard shortcuts

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