common

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KuadrantRateLimitClusterName = "kuadrant-rate-limiting-service"
	AuthPolicyBackRefAnnotation  = "kuadrant.io/authpolicy"
	NamespaceSeparator           = '/'
	LimitadorName                = "limitador"
)

TODO: move the const to a proper place, or get it from config

View Source
const (
	ExtAuthorizerName = "kuadrant-authorization"
)

Variables

This section is empty.

Functions

func DecodeFile

func DecodeFile(ctx context.Context, fileData []byte, scheme *runtime.Scheme, cb DecodeCallback) error

DecodeFile decodes the provided file data (encoded YAML documents) into Kubernetes objects using the specified scheme, and invokes the callback function for each decoded object. Returns an error if any decoding error occurs.

func FindAuthorinoStatusCondition

func FindAuthorinoStatusCondition(conditions []authorinov1beta1.Condition, conditionType string) *authorinov1beta1.Condition

func HasKuadrantAuthorizer added in v0.4.0

func HasKuadrantAuthorizer(configWrapper ConfigWrapper, authorizer KuadrantAuthorizer) (bool, error)

HasKuadrantAuthorizer returns true if the IstioOperator has the Kuadrant ExtensionProvider

func MergeMapStringString added in v0.2.0

func MergeMapStringString(existing *map[string]string, desired map[string]string) bool

MergeMapStringString Merge desired into existing. Not Thread-Safe. Does it matter?

func RegisterKuadrantAuthorizer added in v0.4.0

func RegisterKuadrantAuthorizer(configWrapper ConfigWrapper, authorizer Authorizer) error

RegisterKuadrantAuthorizer adds the Kuadrant ExtensionProvider to the IstioOperator

func ToBase36Hash added in v0.7.0

func ToBase36Hash(s string) string

func ToBase36HashLen added in v0.7.0

func ToBase36HashLen(s string, l int) string

func UnMarshallLimitNamespace added in v0.2.0

func UnMarshallLimitNamespace(ns string) (client.ObjectKey, string, error)

UnMarshallLimitNamespace parses limit namespace with format "gwNS/gwName#domain"

func UnMarshallObjectKey added in v0.2.0

func UnMarshallObjectKey(keyStr string) (client.ObjectKey, error)

UnMarshallObjectKey takes a string input and converts it into an ObjectKey struct that can be used to access a specific Kubernetes object. The input string is expected to be in the format "namespace/name". If the input string does not contain a NamespaceSeparator (typically '/') or has too few components, this function returns an error.

func UnregisterKuadrantAuthorizer added in v0.4.0

func UnregisterKuadrantAuthorizer(configWrapper ConfigWrapper, authorizer Authorizer) error

UnregisterKuadrantAuthorizer removes the Kuadrant ExtensionProvider from the IstioOperator

Types

type Authorizer added in v0.4.0

type Authorizer interface {
	GetExtensionProvider() *istiomeshv1alpha1.MeshConfig_ExtensionProvider
}

type ConfigWrapper added in v0.4.0

type ConfigWrapper interface {
	GetConfigObject() client.Object
	GetMeshConfig() (*istiomeshv1alpha1.MeshConfig, error)
	SetMeshConfig(*istiomeshv1alpha1.MeshConfig) error
}

type DecodeCallback

type DecodeCallback = func(runtime.Object) error

type KuadrantAuthorizer added in v0.4.0

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

func NewKuadrantAuthorizer added in v0.4.0

func NewKuadrantAuthorizer(namespace string) *KuadrantAuthorizer

NewKuadrantAuthorizer Creates a new KuadrantAuthorizer

func (*KuadrantAuthorizer) GetExtensionProvider added in v0.4.0

GetExtensionProvider Returns the Istio MeshConfig ExtensionProvider for Kuadrant

Jump to

Keyboard shortcuts

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