Versions in this module Expand all Collapse all v1 v1.2.6 Mar 24, 2020 Changes in this version + const Version + func PermissionDenied(w http.ResponseWriter, req *http.Request) + func ValidUsernamePassword(username, password string) error + type Permissions struct + func New() (*Permissions, error) + func NewPermissions(state *UserState) *Permissions + func NewWithConf(filename string) (*Permissions, error) + func (perm *Permissions) AddAdminPath(prefix string) + func (perm *Permissions) AddPublicPath(prefix string) + func (perm *Permissions) AddUserPath(prefix string) + func (perm *Permissions) Clear() + func (perm *Permissions) DenyFunction() http.HandlerFunc + func (perm *Permissions) Rejected(w http.ResponseWriter, req *http.Request) bool + func (perm *Permissions) ServeHTTP(w http.ResponseWriter, req *http.Request, next http.HandlerFunc) + func (perm *Permissions) SetAdminPath(pathPrefixes []string) + func (perm *Permissions) SetDenyFunction(f http.HandlerFunc) + func (perm *Permissions) SetPublicPath(pathPrefixes []string) + func (perm *Permissions) SetUserPath(pathPrefixes []string) + func (perm *Permissions) UserState() pinterface.IUserState + type UserState struct + func NewUserState(filename string, randomseed bool) (*UserState, error) + func NewUserStateSimple() (*UserState, error) + func (state *UserState) AddUnconfirmed(username, confirmationCode string) + func (state *UserState) AddUser(username, password, email string) + func (state *UserState) AdminRights(req *http.Request) bool + func (state *UserState) AllUnconfirmedUsernames() ([]string, error) + func (state *UserState) AllUsernames() ([]string, error) + func (state *UserState) AlreadyHasConfirmationCode(confirmationCode string) bool + func (state *UserState) BooleanField(username, fieldname string) bool + func (state *UserState) ClearCookie(w http.ResponseWriter) + func (state *UserState) Close() + func (state *UserState) Confirm(username string) + func (state *UserState) ConfirmUserByConfirmationCode(confirmationCode string) error + func (state *UserState) ConfirmationCode(username string) (string, error) + func (state *UserState) CookieSecret() string + func (state *UserState) CookieTimeout(username string) int64 + func (state *UserState) CorrectPassword(username, password string) bool + func (state *UserState) Creator() pinterface.ICreator + func (state *UserState) Database() *simplebolt.Database + func (state *UserState) Email(username string) (string, error) + func (state *UserState) FindUserByConfirmationCode(confirmationCode string) (string, error) + func (state *UserState) GenerateUniqueConfirmationCode() (string, error) + func (state *UserState) HasUser(username string) bool + func (state *UserState) HashPassword(username, password string) string + func (state *UserState) Host() pinterface.IHost + func (state *UserState) IsAdmin(username string) bool + func (state *UserState) IsConfirmed(username string) bool + func (state *UserState) IsLoggedIn(username string) bool + func (state *UserState) Login(w http.ResponseWriter, username string) error + func (state *UserState) Logout(username string) + func (state *UserState) MarkConfirmed(username string) + func (state *UserState) PasswordAlgo() string + func (state *UserState) PasswordHash(username string) (string, error) + func (state *UserState) Properties(username string) []string + func (state *UserState) RemoveAdminStatus(username string) + func (state *UserState) RemoveUnconfirmed(username string) + func (state *UserState) RemoveUser(username string) + func (state *UserState) SetAdminStatus(username string) + func (state *UserState) SetBooleanField(username, fieldname string, val bool) + func (state *UserState) SetCookieSecret(cookieSecret string) + func (state *UserState) SetCookieTimeout(cookieTime int64) + func (state *UserState) SetLoggedIn(username string) + func (state *UserState) SetLoggedOut(username string) + func (state *UserState) SetMinimumConfirmationCodeLength(length int) + func (state *UserState) SetPassword(username, password string) + func (state *UserState) SetPasswordAlgo(algorithm string) error + func (state *UserState) SetUsernameCookie(w http.ResponseWriter, username string) error + func (state *UserState) SetUsernameCookieOnlyHTTPS(w http.ResponseWriter, username string) error + func (state *UserState) UserRights(req *http.Request) bool + func (state *UserState) Username(req *http.Request) string + func (state *UserState) UsernameCookie(req *http.Request) (string, error) + func (state *UserState) Users() pinterface.IHashMap Incompatible versions in this module v2.6.3+incompatible Jun 25, 2023 v2.6.2+incompatible Jun 25, 2023 Other modules containing this package github.com/xyproto/permissionbolt/v2