v1alpha1

package
v0.0.0-...-a0ba7db Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddToScheme = pacv1alpha1.AddToScheme

Functions

func LoadUrlPrefixAllowListFromFile

func LoadUrlPrefixAllowListFromFile(path string, fileReader FileReader) ([]string, error)

Load the URL prefix' of allowed URLs from a file

func SetupWebhookWithManager

func SetupWebhookWithManager(mgr ctrl.Manager, validator webhook.CustomValidator) error

SetupWebhookWithManager will setup the manager to manage the webhooks

Types

type FileReader

type FileReader func(name string) ([]byte, error)

type RepositoryValidator

type RepositoryValidator struct {
	UrlValidator *URLValidator
}

func (*RepositoryValidator) ValidateCreate

func (r *RepositoryValidator) ValidateCreate(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)

ValidateCreate implements admission.CustomValidator.

func (*RepositoryValidator) ValidateDelete

func (r *RepositoryValidator) ValidateDelete(ctx context.Context, obj runtime.Object) (warnings admission.Warnings, err error)

ValidateDelete implements admission.CustomValidator.

func (*RepositoryValidator) ValidateUpdate

func (r *RepositoryValidator) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (warnings admission.Warnings, err error)

ValidateUpdate implements admission.CustomValidator.

type URLValidationFailedError

type URLValidationFailedError struct{}

func (*URLValidationFailedError) Error

func (u *URLValidationFailedError) Error() string

type URLValidator

type URLValidator struct {
	URLPrefixAllowList []string
}

func (*URLValidator) Validate

func (u *URLValidator) Validate(url string) (admission.Warnings, error)

Jump to

Keyboard shortcuts

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