Documentation
¶
Index ¶
- Constants
- Variables
- func ContextMiddleware(next http.Handler) http.Handler
- func VerifyWebhookSignature(req *http.Request, params *VerifyWebhookSignatureParams) error
- func VerifyWebhookSignatureMiddleware(next http.Handler, params *VerifyWebhookSignatureParams) http.Handler
- type VerifyWebhookSignatureParams
Constants ¶
View Source
const ( WebhookTimestampHeader = "X-Cased-Timestamp" WebhookSignatureHeader = "X-Cased-Signature" )
Variables ¶
Functions ¶
func ContextMiddleware ¶
ContextMiddleware ...
func VerifyWebhookSignature ¶ added in v1.0.2
func VerifyWebhookSignature(req *http.Request, params *VerifyWebhookSignatureParams) error
func VerifyWebhookSignatureMiddleware ¶ added in v1.0.2
func VerifyWebhookSignatureMiddleware(next http.Handler, params *VerifyWebhookSignatureParams) http.Handler
Types ¶
type VerifyWebhookSignatureParams ¶ added in v1.0.2
type VerifyWebhookSignatureParams struct {
// Secret used to compute the HMAC signature. Optional if secret is provided
// by the CASED_WEBHOOK_SECRET environment variable.
Secret *string
// TimestampExpires if provided will reject webhook requests that are
// delivered after specified duration. Useful to prevent replay attacks. Each
// webhook attempt delivered from Cased will provide a new timestamp.
TimestampExpires time.Duration
}
Click to show internal directories.
Click to hide internal directories.