destwebhookstandard

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretPrefix = "whsec_"
	SecretLength = 32 // 32 bytes = 256 bits
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*StandardWebhookDestination)

Option is a functional option for configuring StandardWebhookDestination

func WithHeaderPrefix

func WithHeaderPrefix(prefix string) Option

WithHeaderPrefix sets the prefix for metadata headers (defaults to "webhook-")

func WithProxyURL

func WithProxyURL(proxyURL string) Option

WithProxyURL sets the proxy URL for the webhook request

func WithUserAgent

func WithUserAgent(userAgent string) Option

WithUserAgent sets the user agent for the webhook request

type StandardWebhookDestination

type StandardWebhookDestination struct {
	*destregistry.BaseProvider
	// contains filtered or unexported fields
}

func New

func (*StandardWebhookDestination) ComputeTarget

func (*StandardWebhookDestination) CreatePublisher

func (d *StandardWebhookDestination) CreatePublisher(ctx context.Context, destination *models.Destination) (destregistry.Publisher, error)

func (*StandardWebhookDestination) ObfuscateDestination

func (d *StandardWebhookDestination) ObfuscateDestination(destination *models.Destination) *models.Destination

func (*StandardWebhookDestination) Preprocess

func (d *StandardWebhookDestination) Preprocess(newDestination *models.Destination, originalDestination *models.Destination, opts *destregistry.PreprocessDestinationOpts) error

Preprocess sets a default secret if one isn't provided and handles secret rotation

func (*StandardWebhookDestination) Validate

func (d *StandardWebhookDestination) Validate(ctx context.Context, destination *models.Destination) error

type StandardWebhookDestinationConfig

type StandardWebhookDestinationConfig struct {
	URL string `json:"url"`
}

type StandardWebhookDestinationCredentials

type StandardWebhookDestinationCredentials struct {
	Secret                  string     `json:"secret"`
	PreviousSecret          string     `json:"previous_secret,omitempty"`
	PreviousSecretInvalidAt *time.Time `json:"previous_secret_invalid_at,omitempty"`
}

type StandardWebhookPublisher

type StandardWebhookPublisher struct {
	*destregistry.BasePublisher
	// contains filtered or unexported fields
}

func (*StandardWebhookPublisher) Close

func (p *StandardWebhookPublisher) Close() error

func (*StandardWebhookPublisher) Format

Format creates an HTTP request formatted according to Standard Webhooks specification

func (*StandardWebhookPublisher) Publish

Jump to

Keyboard shortcuts

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