webhook

package
v0.0.0-...-4f85a94 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupAllWebhooks

func SetupAllWebhooks(mgr ctrl.Manager, secretStorage secretstorage.SecretStorage) error

Types

type RemoteSecretMutator

type RemoteSecretMutator struct {
	Client  client.Client
	Storage remotesecretstorage.RemoteSecretStorage
}

func (*RemoteSecretMutator) CopyDataFrom

func (m *RemoteSecretMutator) CopyDataFrom(ctx context.Context, user authv1.UserInfo, rs *api.RemoteSecret) error

func (*RemoteSecretMutator) StoreUploadData

func (m *RemoteSecretMutator) StoreUploadData(ctx context.Context, rs *api.RemoteSecret) error

type RemoteSecretValidator

type RemoteSecretValidator struct{}

func (*RemoteSecretValidator) ValidateCreate

func (a *RemoteSecretValidator) ValidateCreate(_ context.Context, rs *api.RemoteSecret) error

func (*RemoteSecretValidator) ValidateDelete

func (a *RemoteSecretValidator) ValidateDelete(_ context.Context, _ *api.RemoteSecret) error

func (*RemoteSecretValidator) ValidateUpdate

func (a *RemoteSecretValidator) ValidateUpdate(_ context.Context, _, new *api.RemoteSecret) error

type RemoteSecretWebhook

type RemoteSecretWebhook struct {
	Validator WebhookValidator
	Mutator   WebhookMutator
	Decoder   *wh.Decoder
}

+kubebuilder:webhook:path=/mutate-appstudio-redhat-com-v1beta1-remotesecret,mutating=true,failurePolicy=fail,sideEffects=None,groups=appstudio.redhat.com,resources=remotesecrets,verbs=create;update,versions=v1beta1,name=mremotesecret.kb.io,admissionReviewVersions=v1

func (*RemoteSecretWebhook) Handle

func (w *RemoteSecretWebhook) Handle(ctx context.Context, req wh.Request) wh.Response

Handle implements admission.Handler.

type WebhookMutator

type WebhookMutator interface {
	StoreUploadData(context.Context, *api.RemoteSecret) error
	CopyDataFrom(context.Context, authv1.UserInfo, *api.RemoteSecret) error
}

WebhookMutator defines the contract between the RemoteSecretWebhook and the "thing" that mutates the remote secret passed to its methods. This interface mainly exists to ease the testing because it will only ever have one implementation in the production code - the RemoteSecretMutator.

type WebhookValidator

type WebhookValidator interface {
	ValidateCreate(context.Context, *api.RemoteSecret) error
	ValidateUpdate(context.Context, *api.RemoteSecret, *api.RemoteSecret) error
	ValidateDelete(context.Context, *api.RemoteSecret) error
}

WebhookValidator defines the contract between the RemoteSecretWebhook and the "thing" that validates the remote secret passed to its methods. This interface mainly exists to ease the testing because it will only ever have one implementation in the production code - the RemoteSecretValidator.

Jump to

Keyboard shortcuts

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