Documentation
¶
Overview ¶
Package authentication defines interfaces for password hashing and credential verification. Second-factor verification (TOTP, WebAuthn, etc.) lives in sibling packages (e.g. authentication/totp) so callers can compose whichever factors their application needs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
Hasher
// PasswordMatches reports whether password matches hash. A non-match
// returns (false, nil); only genuine errors (malformed hash, runtime
// failure) populate err.
PasswordMatches(ctx context.Context, hash, password string) (bool, error)
}
Authenticator hashes passwords and verifies them against a stored hash.
Second-factor verification (TOTP, WebAuthn, backup codes, etc.) is intentionally NOT part of this interface. Callers compose password verification with any second-factor verifier they need — see the authentication/totp package for the TOTP verifier.
Directories
¶
| Path | Synopsis |
|---|---|
|
mock
Package mock provides moq-generated mock implementations of interfaces in the tokens package.
|
Package mock provides moq-generated mock implementations of interfaces in the tokens package. |
|
Package totp provides a TOTP (RFC 6238) second-factor verifier.
|
Package totp provides a TOTP (RFC 6238) second-factor verifier. |
|
mock
Package mock provides moq-generated mock implementations of interfaces in the totp package.
|
Package mock provides moq-generated mock implementations of interfaces in the totp package. |
Click to show internal directories.
Click to hide internal directories.