processing

package
v0.0.0-...-b7e5c58 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//OwnerLabel .
	OwnerLabel = fmt.Sprintf("%s.%s", "apirule", gatewayv1beta1.GroupVersion.String())
)

Functions

func DeleteAPIRuleSubresources

func DeleteAPIRuleSubresources(k8sClient client.Client, ctx context.Context, apiRule gatewayv1beta1.APIRule) error

func FilterDuplicatePaths

func FilterDuplicatePaths(rules []gatewayv1beta1.Rule) []gatewayv1beta1.Rule

func GetOwnerLabels

func GetOwnerLabels(api *gatewayv1beta1.APIRule) map[string]string

func HasJwtRule

func HasJwtRule(api *gatewayv1beta1.APIRule) bool

func IsJwtSecured

func IsJwtSecured(rule gatewayv1beta1.Rule) bool

func IsSecuredByOathkeeper

func IsSecuredByOathkeeper(rule gatewayv1beta1.Rule) bool

IsSecuredByOathkeeper checks whether the rule contains an access strategy that should lead to the creation of an Oathkeeper rule.

Types

type Action

type Action int

func (Action) String

func (s Action) String() string

type CorsConfig

type CorsConfig struct {
	AllowOrigins []*v1beta1.StringMatch
	AllowMethods []string
	AllowHeaders []string
}

CorsConfig is an internal representation of v1alpha3.CorsPolicy object

type ObjectChange

type ObjectChange struct {
	Action Action
	Obj    client.Object
}

func NewObjectCreateAction

func NewObjectCreateAction(obj client.Object) *ObjectChange

func NewObjectDeleteAction

func NewObjectDeleteAction(obj client.Object) *ObjectChange

func NewObjectUpdateAction

func NewObjectUpdateAction(obj client.Object) *ObjectChange

type ReconciliationCommand

type ReconciliationCommand interface {
	// Validate performs provided APIRule validation in context of the provided client cluster
	Validate(context.Context, client.Client, *gatewayv1beta1.APIRule) ([]validation.Failure, error)

	// GetStatusBase returns ReconciliationStatus that sets unused subresources status to nil and to gatewayv1beta1.StatusCode paramter for all the others
	GetStatusBase(gatewayv1beta1.StatusCode) ReconciliationStatus

	// GetProcessors returns the processor relevant for the reconciliation of this command.
	GetProcessors() []ReconciliationProcessor
}

ReconciliationCommand provides the processors and validation required to reconcile the API rule.

type ReconciliationConfig

type ReconciliationConfig struct {
	OathkeeperSvc     string
	OathkeeperSvcPort uint32
	CorsConfig        *CorsConfig
	DefaultDomainName string
}

type ReconciliationProcessor

type ReconciliationProcessor interface {
	// EvaluateReconciliation returns the changes that needs to be applied to the cluster by comparing the desired with the actual state.
	EvaluateReconciliation(context.Context, client.Client, *gatewayv1beta1.APIRule) ([]*ObjectChange, error)
}

ReconciliationProcessor provides the evaluation of changes during the reconciliation of API Rule.

type ReconciliationStatus

type ReconciliationStatus struct {
	ApiRuleStatus               *gatewayv1beta1.APIRuleResourceStatus
	VirtualServiceStatus        *gatewayv1beta1.APIRuleResourceStatus
	AccessRuleStatus            *gatewayv1beta1.APIRuleResourceStatus
	RequestAuthenticationStatus *gatewayv1beta1.APIRuleResourceStatus
	AuthorizationPolicyStatus   *gatewayv1beta1.APIRuleResourceStatus
}

func GenerateStatusFromFailures

func GenerateStatusFromFailures(failures []validation.Failure, statusBase ReconciliationStatus) ReconciliationStatus

func GetStatusForErrorMap

func GetStatusForErrorMap(errorMap map[ResourceSelector][]error, statusBase ReconciliationStatus) ReconciliationStatus

func Reconcile

Reconcile executes the reconciliation of the APIRule using the given reconciliation command.

func (ReconciliationStatus) HasError

func (status ReconciliationStatus) HasError() bool

type ResourceSelector

type ResourceSelector int
const (
	OnApiRule ResourceSelector = iota
	OnVirtualService
	OnAccessRule
	OnAuthorizationPolicy
	OnRequestAuthentication
)

func (ResourceSelector) String

func (r ResourceSelector) String() string

Directories

Path Synopsis
Package hashbasedstate provides types and functions to compare objects by a hash and a position in a yaml sequence.
Package hashbasedstate provides types and functions to compare objects by a hash and a position in a yaml sequence.
internal

Jump to

Keyboard shortcuts

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