processing

package
v0.0.0-...-85d9d8c Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 15 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 GetOwnerLabelsV2alpha1

func GetOwnerLabelsV2alpha1(api *gatewayv2alpha1.APIRule) map[string]string

GetOwnerLabelsV2alpha1 returns the owner labels for the given APIRule. The owner labels are still set to the old v1beta1 APIRule version. Do not switch the owner labels to the new APIRule version unless absolutely necessary! This has been done before, and it caused a lot of confusion and bugs. If the change for some reason has to be done, please remove the version from the OwnerLabel constant.

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.

func Reconcile

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

func RequiresAuthorizationPolicies

func RequiresAuthorizationPolicies(api *gatewayv1beta1.APIRule) bool

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) ([]validation.Failure, error)

	// GetStatusBase returns ReconciliationV1beta1Status that sets unused subresources status to nil and to gatewayv1beta1.StatusCode paramter for all the others
	GetStatusBase(string) status.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) ([]*ObjectChange, error)
}

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

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.
ory

Jump to

Keyboard shortcuts

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