Categorygithub.com/go-macaron/csrf
modulepackage
0.0.0-20200329073418-5d38f39de352
Repository: https://github.com/go-macaron/csrf.git
Documentation: pkg.go.dev

# README

csrf

GitHub Workflow Status codecov GoDoc Sourcegraph

Middleware csrf generates and validates CSRF tokens for Macaron.

Installation

go get github.com/go-macaron/csrf

Getting Help

License

This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.

# Functions

Csrfer maps CSRF to each request.
Generate maps CSRF to each request.
GenerateToken returns a URL-safe secure XSRF token that expires in 24 hours.
Validate should be used as a per route middleware.
Valid returns true if token is a valid, unexpired token returned by Generate.

# Constants

The duration that XSRF tokens are valid.

# Structs

Options maintains options to manage behavior of Generate.

# Interfaces

CSRF represents a CSRF service and is used to get the current token and validate a suspect token.