csrf

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CsrfFilter

func CsrfFilter(c *revel.Controller, fc []revel.Filter)

CsrfFilter enables CSRF request token creation and verification.

Usage:

  1. Add `csrf.CsrfFilter` to the app's filters (it must come after the revel.SessionFilter).
  2. Add CSRF fields to a form with the template tag `{{ csrftoken . }}`. The filter adds a function closure to the `RenderArgs` that can pull out the secret and make the token as-needed, caching the value in the request. Ajax support provided through the `X-CSRFToken` header.

func IsExempt

func IsExempt(c *revel.Controller) bool

func MarkExempt

func MarkExempt(route string)

func RandomString

func RandomString(length int) (string, error)

func RefreshToken

func RefreshToken(c *revel.Controller)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL