Versions in this module Expand all Collapse all v1 v1.0.1 Aug 23, 2026 v1.0.0 Aug 23, 2026 Changes in this version + const DefaultSessionTTL + const MaxPasswordBytes + const MinPasswordLength + const SessionCookie + var ErrPasswordAlreadySet = errors.New("a password has already been set") + func IsHash(s string) bool + func LoadHash(path string) string + func SaveHash(path, hash string) error + func ValidatePassword(password string) error + type Authenticator struct + func New(password string, sessionTTL time.Duration) (*Authenticator, error) + func (a *Authenticator) Authenticated(token string) bool + func (a *Authenticator) Enabled() bool + func (a *Authenticator) LockedOut(remoteAddr string) bool + func (a *Authenticator) Login(remoteAddr, password string) (string, bool) + func (a *Authenticator) Logout(token string) + func (a *Authenticator) NeedsSetup() bool + func (a *Authenticator) SessionTTL() time.Duration + func (a *Authenticator) SetInitialPassword(plaintext string) (string, error) + func (a *Authenticator) SetPassword(plaintext string) (string, error) + func (a *Authenticator) SetSetupRequired(required bool) + func (a *Authenticator) StartSession() (string, bool)