Documentation
¶
Overview ¶
Package token makes and checks the signed tokens in links and addresses: confirm, unsubscribe, open, click and bounce. A token carries its purpose and a few integer IDs, authenticated with HMAC-SHA256, so handlers verify it without a lookup and nobody can forge or enumerate one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalid = errors.New("invalid token")
ErrInvalid is returned for tokens that are malformed or not signed by us.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind byte
Kind is what a token authorizes.
const ( Confirm Kind = 'c' // confirm membership: member ID Unsub Kind = 'u' // unsubscribe: member ID, issue ID (0 outside issues) Open Kind = 'o' // open pixel: outbound ID Click Kind = 'k' // click: outbound ID, link index Bounce Kind = 'b' // envelope sender (VERP): outbound ID Message Kind = 'm' // Message-ID: outbound ID; it identifies, never authorizes Form Kind = 'f' // signup form render time: unix seconds Hook Kind = 'h' // webhook URL: constant 1 )
Click to show internal directories.
Click to hide internal directories.