Documentation
¶
Overview ¶
Package whauth decides whether a request to a webhook source came from its sender (#1870). It holds no state and writes nothing: the receiver hands it the source, the request's headers, the path token if there was one, and the body, and it answers with nil or with the reason the request is refused.
Every comparison of a secret, or of something computed from one, is constant-time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMissingSignature = errors.New("the signature header is missing") ErrBadSignature = errors.New("the signature does not match") ErrMissingTimestamp = errors.New("the timestamp header is missing") ErrBadTimestamp = errors.New("the timestamp is not a Unix time in seconds or milliseconds") ErrStaleTimestamp = errors.New("the timestamp is outside the tolerance window") ErrMissingToken = errors.New("the token is missing") ErrBadToken = errors.New("the token does not match") ErrBadCredentials = errors.New("the basic credentials do not match") ErrUnknownMode = errors.New("the source's auth mode is not recognized") )
Reasons a request is refused. They are what the source's page lists beside a rejected request, so they name what was wrong without echoing what was sent.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.