Versions in this module Expand all Collapse all v3 v3.3.0 Jul 14, 2023 Changes in this version + const FormValueCode + const FormValueConfirm + const FormValueEmail + const FormValuePassword + const FormValuePhoneNumber + const FormValueRecoveryCode + const FormValueToken + const FormValueUsername + func SetCore(config *authboss.Config, readJSON, useUsername bool) + func URLValuesToMap(form url.Values) map[string]string + type BCryptHasher struct + func NewBCryptHasher(cost int) *BCryptHasher + func (h *BCryptHasher) CompareHashAndPassword(hashedPassword, password string) error + func (h *BCryptHasher) GenerateHash(raw string) (string, error) + type ConfirmValues struct + Token string + func (c ConfirmValues) GetToken() string + type ErrorHandler struct + LogWriter authboss.Logger + func NewErrorHandler(logger authboss.Logger) ErrorHandler + func (e ErrorHandler) Wrap(handler func(w http.ResponseWriter, r *http.Request) error) http.Handler + type FieldError struct + FieldErr error + FieldName string + func NewFieldError(name string, err error) FieldError + func (f FieldError) Err() error + func (f FieldError) Error() string + func (f FieldError) Name() string + type HTTPBodyReader struct + Confirms map[string][]string + ReadJSON bool + Rulesets map[string][]Rules + UseUsername bool + Whitelist map[string][]string + func NewHTTPBodyReader(readJSON, useUsernameNotEmail bool) *HTTPBodyReader + func (h HTTPBodyReader) Read(page string, r *http.Request) (authboss.Validator, error) + type HTTPFormValidator struct + ConfirmFields []string + Ruleset []Rules + Values map[string]string + func (h HTTPFormValidator) Validate() []error + type JSONRenderer struct + Failures []string + func (JSONRenderer) Load(names ...string) error + func (j JSONRenderer) Render(ctx context.Context, page string, data authboss.HTMLData) (output []byte, contentType string, err error) + type LogMailer struct + func NewLogMailer(writer io.Writer) *LogMailer + func (l LogMailer) Send(ctx context.Context, mail authboss.Email) error + type Logger struct + Writer io.Writer + func NewLogger(writer io.Writer) Logger + func (l Logger) Error(s string) + func (l Logger) Info(s string) + type RecoverEndValues struct + NewPassword string + Token string + func (r RecoverEndValues) GetPassword() string + func (r RecoverEndValues) GetToken() string + type RecoverMiddleValues struct + Token string + func (r RecoverMiddleValues) GetToken() string + type RecoverStartValues struct + PID string + func (r RecoverStartValues) GetPID() string + type Redirector struct + CorceRedirectTo200 bool + FormValueName string + Renderer authboss.Renderer + func NewRedirector(renderer authboss.Renderer, formValueName string) *Redirector + func (r *Redirector) Redirect(w http.ResponseWriter, req *http.Request, ro authboss.RedirectOptions) error + type Responder struct + Renderer authboss.Renderer + func NewResponder(renderer authboss.Renderer) *Responder + func (r *Responder) Respond(w http.ResponseWriter, req *http.Request, code int, page string, ...) error + type Router struct + func NewRouter() *Router + func (r *Router) Delete(path string, handler http.Handler) + func (r *Router) Get(path string, handler http.Handler) + func (r *Router) Post(path string, handler http.Handler) + func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) + type Rules struct + AllowWhitespace bool + FieldName string + MatchError string + MaxLength int + MinLength int + MinLetters int + MinLower int + MinNumeric int + MinSymbols int + MinUpper int + MustMatch *regexp.Regexp + Required bool + func (r Rules) Errors(toValidate string) authboss.ErrorList + func (r Rules) IsValid(toValidate string) bool + func (r Rules) Rules() []string + type SMSTwoFA struct + Code string + PhoneNumber string + RecoveryCode string + func (s SMSTwoFA) GetCode() string + func (s SMSTwoFA) GetPhoneNumber() string + func (s SMSTwoFA) GetRecoveryCode() string + type SMTPMailer struct + Auth smtp.Auth + Server string + func NewSMTPMailer(server string, auth smtp.Auth) *SMTPMailer + func (s SMTPMailer) Send(ctx context.Context, mail authboss.Email) error + type Sha512CredsGenerator struct + func NewSha512CredsGenerator() *Sha512CredsGenerator + func (cg *Sha512CredsGenerator) GenerateCreds() (selector, verifier, token string, err error) + func (cg *Sha512CredsGenerator) ParseToken(rawToken string) (selectorBytes, verifierBytes []byte) + func (cg *Sha512CredsGenerator) TokenSize() int + type TwoFA struct + Code string + RecoveryCode string + func (t TwoFA) GetCode() string + func (t TwoFA) GetRecoveryCode() string + type UserValues struct + Arbitrary map[string]string + PID string + Password string + func (u UserValues) GetPID() string + func (u UserValues) GetPassword() string + func (u UserValues) GetShouldRemember() bool + func (u UserValues) GetValues() map[string]string