Documentation
¶
Overview ¶
Package token signs and parses the HS256 JSON Web Tokens the server hands out: the session tokens of package usersession and billing's order event tickets. It checks only the signature and the expiry; what a token grants is for the package that issued it to decide.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewJwtToken ¶
NewJwtToken Generate and return jwt token with given data.
func ParseJwtToken ¶
ParseJwtToken parses a token this package issued and returns its claims. Only HS256 is accepted, the algorithm NewJwtToken signs with, so a token declaring another algorithm ("none", an RSA one) is refused before its signature is looked at; and an expiry is required, since every token this package issues carries one, so a forged token cannot live forever by leaving it out.