Documentation ¶
Index ¶
- Constants
- Variables
- func GetAPIRuleFor(rules []apirulev1beta1.Rule, namespace ...string) *apirulev1beta1.APIRule
- func GetFakeClient(objs ...client.Object) client.Client
- func GetJwtRuleWithService(jwtIssuer, jwksUri, serviceName string, namespace ...string) apirulev1beta1.Rule
- func GetRawConfig(config any) *runtime.RawExtension
- func GetRuleFor(path string, methods []apirulev1beta1.HttpMethod, ...) apirulev1beta1.Rule
- func GetRuleWithServiceFor(path string, methods []apirulev1beta1.HttpMethod, ...) apirulev1beta1.Rule
- func GetService(name string, namespace ...string) *corev1.Service
- func GetTestConfig() processing.ReconciliationConfig
- func ToCSVList(input []string) string
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 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 GetTestConfig ¶
func GetTestConfig() processing.ReconciliationConfig
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.