Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFMiddleware ¶
func CSRFMiddleware(config CSRFConfig) core.Middleware
CSRFMiddleware returns a middleware that handles CSRF
Types ¶
type CSRFConfig ¶
type CSRFConfig struct {
// TokenLength is the length of the CSRF token
TokenLength uint8
// CookieName is the name of the CSRF cookie
CookieName string
// CookiePath is the path of the CSRF cookie
CookiePath string
// CookieExpires is the expiration time of the CSRF cookie
CookieExpires time.Duration
// CookieSecure is the secure flag of the CSRF cookie
CookieSecure bool
// CookieHTTPOnly is the HTTPOnly flag of the CSRF cookie
CookieHTTPOnly bool
// HeaderName is the name of the CSRF header
HeaderName string
}
CSRFConfig holds the configuration for the CSRF middleware
func DefaultCSRFConfig ¶
func DefaultCSRFConfig() CSRFConfig
DefaultCSRFConfig returns a default CSRF configuration
Click to show internal directories.
Click to hide internal directories.