class Azu::Handler::CSRF

Overview

The CSRF Handler adds support for Cross Site Request Forgery.

Defined in:

azu/handler/csrf.cr

Constant Summary

CHECK_METHODS = ["PUT", "POST", "PATCH", "DELETE"] of ::String
CSRF_KEY = "csrf.token"
HEADER_KEY = "X-CSRF-TOKEN"
PARAM_KEY = "_csrf"
TOKEN_LENGTH = 32

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(cookie_provider) #

[View source]

Class Method Detail

def self.metatag(context) #

[View source]
def self.tag(context) #

[View source]
def self.token(context) #

[View source]
def self.token_strategy : PersistentToken | RefreshableToken #

[View source]
def self.token_strategy=(token_strategy : PersistentToken | RefreshableToken) #

[View source]

Instance Method Detail

def call(context : HTTP::Server::Context) #

[View source]
def valid_http_method?(context) #

[View source]