referencegrant

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reference

type Reference struct {
	// Group is the API group of the resource (empty string for core group).
	Group string
	// Kind is the kind of the resource.
	Kind string
	// Namespace is the namespace of the resource.
	Namespace string
	// Name is the name of the resource.
	Name string
}

Reference represents a reference from one resource to another.

type Validator

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

Validator validates cross-namespace references against ReferenceGrant resources.

func NewValidator

func NewValidator(k8sClient client.Client) *Validator

NewValidator creates a new ReferenceGrant validator.

func (*Validator) IsReferenceAllowed

func (v *Validator) IsReferenceAllowed(ctx context.Context, fromRef, toRef Reference) (bool, error)

IsReferenceAllowed checks if a reference from one resource to another is allowed based on ReferenceGrant resources.

References within the same namespace are always allowed. Cross-namespace references require a ReferenceGrant in the target namespace.

Jump to

Keyboard shortcuts

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