csrf

package
v0.0.0-...-96ffb46 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 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 `ViewArgs` 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) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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