webhook

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// TokenLength is the length of generated webhook tokens in bytes (64 characters hex)
	TokenLength = 32
	// ManagedByLabel indicates the secret is managed by this controller
	ManagedByLabel = "app.kubernetes.io/managed-by"
	// ControllerName is the name of this controller
	ControllerName = "flux-extension-controller"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles webhook token generation and secret management

func NewManager

func NewManager(client client.Client, baseURL string) *Manager

NewManager creates a new webhook manager

func (*Manager) ConstructWebhookURL

func (m *Manager) ConstructWebhookURL(webhookPath string) (string, error)

ConstructWebhookURL constructs the full webhook URL from base URL and webhook path

func (*Manager) EnsureWebhookSecret

func (m *Manager) EnsureWebhookSecret(ctx context.Context, namespace, secretName string, owner client.Object) (string, error)

EnsureWebhookSecret creates or retrieves the webhook secret for a receiver If the secret doesn't exist, it creates one with a new token If the secret exists and is managed by us, it reuses the existing token Returns the token value and any error

func (*Manager) GenerateToken

func (m *Manager) GenerateToken() (string, error)

GenerateToken generates a cryptographically secure random token

func (*Manager) IsWebhookConfigured

func (m *Manager) IsWebhookConfigured() bool

IsWebhookConfigured returns true if webhook base URL is configured

Jump to

Keyboard shortcuts

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