Documentation
¶
Overview ¶
Package tokentransfer moves an author's identity to another browser (etherpad-lite's /tokenTransfer): the first browser asks for a code, the second redeems it within five minutes, once, and gets the same author token as an HttpOnly cookie plus the pad preferences. The token never appears in a response body.
Index ¶
Constants ¶
const TTL = 5 * time.Minute
TTL is how long a code can be redeemed.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
Handler serves POST /tokenTransfer and GET /tokenTransfer/:id.
func (*Handler) Create ¶
Create answers POST /tokenTransfer: a code for the requester's author token cookie (it is HttpOnly, so the browser cannot send it any other way).
func (*Handler) Redeem ¶
Redeem answers POST /tokenTransfer/:id from a page of this site: 404 for an unknown or used code, 410 for an expired one; otherwise this browser takes over the author token. Not a GET, and never from another site: a link, an image or a form elsewhere must not swap a visitor's identity for one the attacker also holds. The welcome page asks before it redeems.