Documentation ¶
Index ¶
- Variables
- type Authenticator
- type PasswordAuthenticator
- func (auth *PasswordAuthenticator) Authenticate(password string) error
- func (auth *PasswordAuthenticator) CheckResetCode(code string) error
- func (auth *PasswordAuthenticator) IsDirty() bool
- func (auth *PasswordAuthenticator) ResetPassword(dur time.Duration) (string, error)
- func (auth *PasswordAuthenticator) Scan(value interface{}) error
- func (auth *PasswordAuthenticator) SetPassword(password string, inputs ...string) error
- func (auth *PasswordAuthenticator) Value() (driver.Value, error)
- type TwoFactorAuthenticator
- func (auth *TwoFactorAuthenticator) Authenticate(code string) error
- func (auth *TwoFactorAuthenticator) Configure() (*TwoFactorConfig, error)
- func (auth *TwoFactorAuthenticator) ConsumeRecoveryKey(code string) bool
- func (auth *TwoFactorAuthenticator) GenCode() string
- func (auth *TwoFactorAuthenticator) IsDirty() bool
- func (auth *TwoFactorAuthenticator) QRCode() ([]byte, error)
- func (auth *TwoFactorAuthenticator) QRCodeDataURI() (string, error)
- func (auth *TwoFactorAuthenticator) Scan(value interface{}) error
- func (auth *TwoFactorAuthenticator) URI() string
- func (auth *TwoFactorAuthenticator) Value() (driver.Value, error)
- type TwoFactorConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyPassword = errors.New("empty password")
View Source
var ErrInvalid2FACode = errors.New("invalid two factor authentication code")
View Source
var ErrInvalidPassword = errors.New("invalid login credentials")
View Source
var ErrInvalidResetCode = errors.New("invalid reset code")
View Source
var ErrNotEnoughSystemEntropy = errors.New("not enough system entropy")
View Source
var ErrPasswordTooSimple = errors.New("password too simple")
View Source
var ErrTwoFactorNotConfigured = errors.New("two factor authentication not configured")
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type PasswordAuthenticator ¶
type PasswordAuthenticator struct { Hasher string `json:"hasher"` HashedPassword string `json:"password"` ResetCode *string `json:"reset_code"` ResetCodeExpires *time.Time `json:"reset_code_expires"` // contains filtered or unexported fields }
func NewPasswordAuthenticator ¶
func NewPasswordAuthenticator(password string) (*PasswordAuthenticator, error)
func (*PasswordAuthenticator) Authenticate ¶
func (auth *PasswordAuthenticator) Authenticate(password string) error
func (*PasswordAuthenticator) CheckResetCode ¶
func (auth *PasswordAuthenticator) CheckResetCode(code string) error
func (*PasswordAuthenticator) IsDirty ¶
func (auth *PasswordAuthenticator) IsDirty() bool
func (*PasswordAuthenticator) ResetPassword ¶
func (auth *PasswordAuthenticator) ResetPassword(dur time.Duration) (string, error)
func (*PasswordAuthenticator) Scan ¶
func (auth *PasswordAuthenticator) Scan(value interface{}) error
func (*PasswordAuthenticator) SetPassword ¶
func (auth *PasswordAuthenticator) SetPassword(password string, inputs ...string) error
type TwoFactorAuthenticator ¶
type TwoFactorAuthenticator struct { Domain string `json:"domain"` Username string `json:"username"` Secret string `json:"secret"` RecoveryKeys []string `json:"recovery_keys"` // contains filtered or unexported fields }
func NewTwoFactorAuthenticator ¶
func NewTwoFactorAuthenticator(username, domain string) (*TwoFactorAuthenticator, error)
func (*TwoFactorAuthenticator) Authenticate ¶
func (auth *TwoFactorAuthenticator) Authenticate(code string) error
func (*TwoFactorAuthenticator) Configure ¶
func (auth *TwoFactorAuthenticator) Configure() (*TwoFactorConfig, error)
func (*TwoFactorAuthenticator) ConsumeRecoveryKey ¶
func (auth *TwoFactorAuthenticator) ConsumeRecoveryKey(code string) bool
func (*TwoFactorAuthenticator) GenCode ¶
func (auth *TwoFactorAuthenticator) GenCode() string
func (*TwoFactorAuthenticator) IsDirty ¶
func (auth *TwoFactorAuthenticator) IsDirty() bool
func (*TwoFactorAuthenticator) QRCode ¶
func (auth *TwoFactorAuthenticator) QRCode() ([]byte, error)
func (*TwoFactorAuthenticator) QRCodeDataURI ¶
func (auth *TwoFactorAuthenticator) QRCodeDataURI() (string, error)
func (*TwoFactorAuthenticator) Scan ¶ added in v0.0.3
func (auth *TwoFactorAuthenticator) Scan(value interface{}) error
func (*TwoFactorAuthenticator) URI ¶
func (auth *TwoFactorAuthenticator) URI() string
Click to show internal directories.
Click to hide internal directories.