Documentation ¶
Index ¶
- func GenRandNumber3x() (buf string)
- type GenerateXSRFHandlerType
- func (hdlr *GenerateXSRFHandlerType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *GenerateXSRFHandlerType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *GenerateXSRFHandlerType) ServeHTTP(www http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenRandNumber3x ¶
func GenRandNumber3x() (buf string)
GenRandNumber3x Generates a random value that is 0x100000 or larger
Types ¶
type GenerateXSRFHandlerType ¶
type GenerateXSRFHandlerType struct { Next http.Handler // Paths []string // Base []string // If avaiable the ${1} matching nth base will be used - else - the Host ValidPaths []string // UserCookieName string // if Name starts with "-" then delete existing header before creating new one. ValueCookieName string // if Name starts with "-" then delete existing header before creating new one. RedisPrefix string // Key prefix to save users under in redis, default XSRF: RedisSessionPrefix string // Alternative prefix if using sessions, "Session:" for example MaxAge int // RedirectToLogin bool // LoginURL []string // Positional match to ValidPaths - if it matches that Nth valid path and RedirectToLogin is true and you have this then 307 redirect to that location. LineNo int // // contains filtered or unexported fields }
GenerateXSRFHandlerType keeps all the configuration for this middleware
func (*GenerateXSRFHandlerType) InitializeWithConfigData ¶
func (hdlr *GenerateXSRFHandlerType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)
func (*GenerateXSRFHandlerType) PreValidate ¶
func (hdlr *GenerateXSRFHandlerType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)
func (*GenerateXSRFHandlerType) ServeHTTP ¶
func (hdlr *GenerateXSRFHandlerType) ServeHTTP(www http.ResponseWriter, req *http.Request)
ServeHTTP called in stack implements the token add and check.
Click to show internal directories.
Click to hide internal directories.