Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSignatureHeaderButNoSecret = errors.New("secret not configured for validating webhook signature") ErrSecretButNoSignatureHeader = errors.New("secret configured but no signature header found in request") ErrMultipleSignatureHeaders = errors.New("multiple signature headers found") ErrInvalidSignature = errors.New("invalid signature in request") )
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication struct { Secret config.SecretSource `json:"secret"` HeaderName string `json:"headerName"` CustomValidator func(bodyData []byte, secret, expectedSignature string) bool `json:"-"` }
func (Authentication) CheckSignature ¶
func (a Authentication) CheckSignature(req webhook.ValidatingRequest) error
CheckSignature will read the webhook signature header and the given secret for validating the webhook payload. It will fail if there is a mismatch in the signatures
func (Authentication) Validate ¶
func (a Authentication) Validate() error
Validate checks if the HMAC configuration is valid. It requires that both secret and headerName are set
Click to show internal directories.
Click to hide internal directories.