Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultHashCost = bcrypt.DefaultCost
DefaultHashCost is bcrypt's cost factor. Tests lower it (bcrypt.MinCost) for speed — same knob as the old package-level authority.PasswordHashCost.
Functions ¶
func DummyCompare ¶
DummyCompare burns the same time a real bcrypt comparison would, so a caller can't distinguish "no such user" from "wrong password" by timing.
func HashPassword ¶
HashPassword is the ONLY place bcrypt.GenerateFromPassword is called in this repo. authority/credentials_password.go calls this — it never calls bcrypt directly.
func VerifyPassword ¶
VerifyPassword is the ONLY place bcrypt.CompareHashAndPassword is called for a real (non-dummy) comparison in this repo.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func New ¶
func New(store user.IdentityStore, sessions user.SessionIssuer, notify user.SecurityNotifier, opts ...Option) *Authenticator
New builds the email+password mode. store/sessions/notify are required ports; everything else is an Option with a safe zero-value default.
func (*Authenticator) Mount ¶
func (a *Authenticator) Mount(r router.Router)
func (*Authenticator) Name ¶
func (a *Authenticator) Name() string
type Option ¶
type Option func(*Authenticator)