processing_test

package
v0.0.0-...-d0b8644 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ApiName                     = "test-apirule"
	ApiUID            types.UID = "eab0f1c8-c417-11e9-bf11-4ac644044351"
	ApiNamespace                = "some-namespace"
	ApiAPIVersion               = "gateway.kyma-project.io/v1alpha1"
	ApiKind                     = "ApiRule"
	ApiPath                     = "/.*"
	HeadersApiPath              = "/headers"
	ImgApiPath                  = "/img"
	JwtIssuer                   = "https://oauth2.example.com/"
	JwksUri                     = "https://oauth2.example.com/.well-known/jwks.json"
	JwtIssuer2                  = "https://oauth2.another.example.com/"
	JwksUri2                    = "https://oauth2.another.example.com/.well-known/jwks.json"
	OathkeeperSvc               = "fake.oathkeeper"
	OathkeeperSvcPort uint32    = 1234
	TestLabelKey                = "key"
	TestLabelValue              = "value"
	DefaultDomain               = "myDomain.com"
	TestSelectorKey             = "app"
)

Variables

View Source
var (
	ApiMethods                     = []apirulev1beta1.HttpMethod{http.MethodGet}
	ApiScopes                      = []string{"write", "read"}
	ServicePort             uint32 = 8080
	ApiGateway                     = "some-gateway"
	ServiceName                    = "example-service"
	ServiceHostWithNoDomain        = "myService"
	ServiceHost                    = ServiceHostWithNoDomain + "." + DefaultDomain

	TestAllowOrigin  = []*v1beta1.StringMatch{{MatchType: &v1beta1.StringMatch_Regex{Regex: ".*"}}}
	TestAllowMethods = []apirulev1beta1.HttpMethod{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
	TestAllowHeaders = []string{"header1", "header2"}
	TestCors         = &processing.CorsConfig{
		AllowOrigins: []*v1beta1.StringMatch{{MatchType: &v1beta1.StringMatch_Regex{Regex: ".*"}}},
		AllowMethods: []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete},
		AllowHeaders: []string{"header1", "header2"},
	}
)
View Source
var ActionToString = func(a processing.Action) string { return a.String() }

Functions

func GetAPIRuleFor

func GetAPIRuleFor(rules []apirulev1beta1.Rule, namespace ...string) *apirulev1beta1.APIRule

func GetFakeClient

func GetFakeClient(objs ...client.Object) client.Client

func GetJwtRuleWithService

func GetJwtRuleWithService(jwtIssuer, jwksUri, serviceName string, namespace ...string) apirulev1beta1.Rule

func GetRawConfig

func GetRawConfig(config any) *runtime.RawExtension

func GetRuleFor

func GetRuleFor(path string, methods []apirulev1beta1.HttpMethod, mutators []*apirulev1beta1.Mutator, accessStrategies []*apirulev1beta1.Authenticator) apirulev1beta1.Rule

func GetRuleWithServiceFor

func GetRuleWithServiceFor(path string, methods []apirulev1beta1.HttpMethod, mutators []*apirulev1beta1.Mutator, accessStrategies []*apirulev1beta1.Authenticator, service *apirulev1beta1.Service) apirulev1beta1.Rule

func GetService

func GetService(name string, namespace ...string) *corev1.Service

func GetTestConfig

func GetTestConfig() processing.ReconciliationConfig

func ToCSVList

func ToCSVList(input []string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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