Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSRFMiddleware ¶
func CSRFMiddleware() buffalo.MiddlewareFunc
CSRFMiddleware wraps Buffalo's CSRF middleware with better defaults
func Middleware ¶
func Middleware(opts Options) buffalo.MiddlewareFunc
Middleware returns security middleware for Buffalo
func RateLimitMiddleware ¶
func RateLimitMiddleware(requestsPerMinute int) buffalo.MiddlewareFunc
RateLimitMiddleware provides basic rate limiting
Types ¶
type Options ¶
type Options struct {
// DevMode disables some security features for development
DevMode bool
// ContentTypeOptions sets X-Content-Type-Options header
ContentTypeNosniff bool
// FrameOptions sets X-Frame-Options header
FrameDeny bool
FrameSameOrigin bool
// XSSProtection sets X-XSS-Protection header
XSSProtection bool
// ContentSecurityPolicy sets CSP header
ContentSecurityPolicy string
// StrictTransportSecurity sets HSTS header
STSSeconds int64
STSIncludeSubdomains bool
STSPreload bool
// ReferrerPolicy sets Referrer-Policy header
ReferrerPolicy string
}
Options configures the security middleware
Click to show internal directories.
Click to hide internal directories.