Versions in this module Expand all Collapse all v0 v0.1.0 Feb 3, 2018 Changes in this version + const HashRounds + const MinPasswordLength + const MinZxcvbnScore + var ErrorAddingToken = errors.New("User Controller: error adding token") + var ErrorCreatingUser = errors.New("User Controller: error creating user") + var ErrorDuplicateAccount = errors.New("User Controller: user account with email or username already exists") + var ErrorFindingUser = errors.New("User Controller: error checking for user account") + var ErrorPasswordEntropyTooLow = errors.New("User controller: password entropy too low") + var ErrorPasswordHashTooShort = errors.New("User Controller: password hash too short") + var ErrorPasswordMismatch = errors.New("User Controller: password mismatch") + var ErrorPasswordTooShort = errors.New("User Controller: password does not meet complexity requirements") + var ErrorUpdatingToken = errors.New("User Controller: error updating token") + var ErrorUpdatingUser = errors.New("User Controller: error updating user") + var ErrorUserNotFound = errors.New("User Controller: user not found") + func BindUserContext(userModule *Controller) func(ctx *apiCtx, rw web.ResponseWriter, req *web.Request, ...) + type Controller struct + func NewController(userStore Storer, emitter events.Emitter) *Controller + func (userModule *Controller) Activate(email string) (user User, err error) + func (userModule *Controller) BindAPI(router *web.Router) + func (userModule *Controller) Create(email, username, pass string) (user User, err error) + func (userModule *Controller) GetUser(userid string) (interface{}, error) + func (userModule *Controller) GetUserByEmail(email string) (interface{}, error) + func (userModule *Controller) HandleToken(userid string, action api.TokenAction) (err error) + func (userModule *Controller) Lock(email string) (user User, err error) + func (userModule *Controller) Login(email string, pass string) (bool, interface{}, error) + func (userModule *Controller) PostLoginFailure(u interface{}) error + func (userModule *Controller) PostLoginSuccess(u interface{}) error + func (userModule *Controller) PreLogin(u interface{}) (bool, error) + func (userModule *Controller) SetPassword(userid, password string) (User, error) + func (userModule *Controller) Unlock(email string) (user User, err error) + func (userModule *Controller) UpdatePassword(userid string, old string, new string) (User, error) + type Storer interface + AddUser func(email, username, pass string) (interface{}, error) + GetUserByEmail func(email string) (interface{}, error) + GetUserByExtID func(userid string) (interface{}, error) + GetUserByUsername func(username string) (interface{}, error) + UpdateUser func(user interface{}) (interface{}, error) + type User interface + GetCreatedAt func() time.Time + GetEmail func() string + GetExtID func() string + GetLastLogin func() time.Time + GetLoginRetries func() uint + GetPassword func() string + GetPasswordChanged func() time.Time + GetUsername func() string + IsActivated func() bool + IsAdmin func() bool + IsEnabled func() bool + IsLocked func() bool + SetActivated func(activated bool) + SetEnabled func(locked bool) + SetLastLogin func(t time.Time) + SetLocked func(locked bool) + SetLoginRetries func(retries uint) + SetPassword func(pass string) + type UserResp struct + Activated bool + CreatedAt time.Time + Email string + Enabled bool + ExtID string + LastLogin time.Time + Locked bool + Username string + func (ur *UserResp) GetEmail() string + func (ur *UserResp) GetExtID() string