Documentation
¶
Index ¶
- type Extension
- func (s *Extension) EnforceEmailValidated(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func (s *Extension) EnforceLoggedIn(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func (s *Extension) EnforceParamMatchesCallerID(param string, routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
- func (s *Extension) GetAttribute(r *http.Request, attribute string) (interface{}, error)
- func (s *Extension) GetCaller(r *http.Request) (*nibbler.User, error)
- func (s *Extension) GetName() string
- func (s *Extension) Init(app *nibbler.Application) error
- func (s *Extension) SetAttribute(w http.ResponseWriter, r *http.Request, key string, value interface{}) error
- func (s *Extension) SetCaller(w http.ResponseWriter, r *http.Request, userValue *nibbler.User) error
- type StoreConnector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extension ¶
type Extension struct { nibbler.NoOpExtension SessionName string StoreConnector StoreConnector // creates cookie store if not provided // contains filtered or unexported fields }
func (*Extension) EnforceEmailValidated ¶ added in v0.19.0
func (s *Extension) EnforceEmailValidated(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
EnforceEmailValidated validates the user is logged in and that user's email has been validated. Note that the session extension can't validate emails, but extensions like the user-local-auth extension can
func (*Extension) EnforceLoggedIn ¶ added in v0.19.0
func (s *Extension) EnforceLoggedIn(routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
func (*Extension) EnforceParamMatchesCallerID ¶ added in v0.19.0
func (s *Extension) EnforceParamMatchesCallerID(param string, routerFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)
EnforceParamMatchesCallerID will validate that the user is logged in and is requesting a resource that's identified by a user ID that matches the caller's ID. The param argument to this function determines which path param is checked against the caller's ID.
func (*Extension) GetAttribute ¶
func (*Extension) SetAttribute ¶
func (s *Extension) SetAttribute(w http.ResponseWriter, r *http.Request, key string, value interface{}) error
TODO: SetAttributes to set multiple attributes in one save
Click to show internal directories.
Click to hide internal directories.