Discover Packages
github.com/lxc/lxd-pkg-ubuntu
dist
src
golang.org
x
net
xsrftoken
package
Version:
v0.0.0-...-8dc4a41
Opens a new window with list of versions in this module.
Published: May 25, 2018
License: Apache-2.0, BSD-3-Clause
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Overview Index Constants Variables Functions Types Generate(key, userID, actionID) Valid(token, key, userID, actionID)
Documentation
¶
Package xsrftoken provides methods for generating and validating secure XSRF tokens.
Timeout is the duration for which XSRF tokens are valid.
It is exported so clients may set cookie timeouts that match generated tokens.
Generate returns a URL-safe secure XSRF token that expires in 24 hours.
key is a secret key for your application; it must be non-empty.
userID is an optional unique identifier for the user.
actionID is an optional action the user is taking (e.g. POSTing to a particular path).
func Valid(token, key, userID, actionID string ) bool
Valid reports whether a token is a valid, unexpired token returned by Generate.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.