Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// Names for Header and Form fields to check
Header, Form string
http.Handler
utils.FailureHandler
}
An Authenticator is responsible for pulling the token out of the given http request.
func (Authenticator) Authenticate ¶
func (t Authenticator) Authenticate(token tokens.Token, w http.ResponseWriter, r *http.Request)
type Config ¶
type Config struct {
// Names for Header and Form fields to check
Header, Form string
// CSRF cookie token for use by javascript libraries.
CookieToken http.Cookie
// responsible for storing a token safely
// and generating new tokens.
tokens.TokenStorage
// Matchers that short circuit the request before
// we check the token.
ShortCircuit []matchers.RequestMatcherFactory
// Handler for failures
utils.FailureHandler
}
func DefaultSessionXSRF ¶
func DefaultSessionXSRF() Config
type Csrf ¶
type Csrf struct { CookieToken http.Cookie tokens.TokenStorage ShortCircuit []matchers.RequestMatcher Authenticator }
type TokenStorage ¶
type TokenStorage tokens.TokenStorage
Click to show internal directories.
Click to hide internal directories.