Documentation ¶
Index ¶
- Variables
- type Auth
- func (a *Auth) Check2FA(code string) error
- func (a *Auth) CheckPassword(password string) error
- func (a *Auth) CheckResetCode(code string) error
- func (a *Auth) Complete2FA(code string) error
- func (a *Auth) Configure2FA(username, domain string) (uri string, recoveryKeys []string, err error)
- func (a *Auth) Get2FACode() string
- func (a *Auth) Has2FA() bool
- func (a *Auth) IsDirty() bool
- func (a *Auth) ResetPassword(dur time.Duration) (string, error)
- func (a *Auth) Scan(value interface{}) error
- func (a *Auth) SetPassword(password string, inputs ...string) error
- func (a *Auth) Value() (driver.Value, error)
- type TwoFactor
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 ErrInvalidResetCode = errors.New("invalid reset code")
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 Auth ¶
type Auth struct { Password string `json:"password"` ResetCode *string `json:"reset_code"` ResetCodeExpires *time.Time `json:"reset_code_expires"` TwoFactor *TwoFactor `json:"two_factor"` InitTwoFactor *TwoFactor `json:"init_two_factor"` // contains filtered or unexported fields }
func (*Auth) CheckPassword ¶
func (*Auth) CheckResetCode ¶
func (*Auth) Complete2FA ¶
func (*Auth) Configure2FA ¶
func (*Auth) Get2FACode ¶ added in v0.0.2
type TwoFactor ¶
type TwoFactor struct { Secret string `json:"secret"` RecoveryKeys []string `json:"recovery_keys"` }
func NewTwoFactor ¶
func (*TwoFactor) ConsumeRecoveryKey ¶
Click to show internal directories.
Click to hide internal directories.