Documentation
¶
Overview ¶
Package whsetup answers the checks a webhook sender makes of an address before it delivers to it (#2223): Slack's url_verification and monday.com's challenge echoed back, Zoom's endpoint.url_validation answered with an HMAC of its token, Discord's PING answered with a PONG, and Microsoft Graph's validation token returned as plain text.
It decides whether a request is a source's setup check and what the answer is. It writes nothing and counts nothing: the receiver writes the answer, counts it as a setup check, and stores nothing for it.
Index ¶
Constants ¶
const ( ContentJSON = "application/json" // ContentText is Graph's validation answer, which must be plain text. ContentText = "text/plain; charset=utf-8" )
Content types an answer is written in.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
Answer is the body a setup check is answered 200 with.
func AfterVerification ¶
AfterVerification answers the checks made of a request that has verified: Zoom's url_validation, whose answer is an HMAC under the source's secret (answered unverified, it would sign any text for anyone, which forges Zoom signatures), and Discord's PING, which Discord expects refused unsigned.
func BeforeVerification ¶
BeforeVerification answers a challenge_echo source's check with its challenge. monday.com does not sign its challenge, so it is answered before the request is verified; echoing it hands the caller back only what it sent.
func FromQuery ¶
FromQuery answers a graph_validation source's validation request, which is read from the address alone: the token, URL-decoded, as plain text. It is answered before the body is read or verified, since Graph's validation carries no clientState, and is never written into an HTML or JSON body.