webhook

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

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