Documentation ¶
Index ¶
- Variables
- func TranslateTOTPError(err error) error
- type Provider
- func (p *Provider) Authenticate(a *authenticator.TOTP, code string) error
- func (p *Provider) Create(a *authenticator.TOTP) error
- func (p *Provider) Delete(a *authenticator.TOTP) error
- func (p *Provider) Get(userID string, id string) (*authenticator.TOTP, error)
- func (p *Provider) GetMany(ids []string) ([]*authenticator.TOTP, error)
- func (p *Provider) List(userID string) ([]*authenticator.TOTP, error)
- func (p *Provider) New(id string, userID string, totpSpec *authenticator.TOTPSpec, isDefault bool, ...) (*authenticator.TOTP, error)
- type Store
- func (s *Store) Create(a *authenticator.TOTP) (err error)
- func (s *Store) Delete(id string) error
- func (s *Store) Get(userID string, id string) (*authenticator.TOTP, error)
- func (s *Store) GetMany(ids []string) ([]*authenticator.TOTP, error)
- func (s *Store) List(userID string) ([]*authenticator.TOTP, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Store), "*"), wire.Struct(new(Provider), "*"), )
View Source
var ErrInvalidCode = errors.New("invalid code")
View Source
var InvalidTOTPSecret = apierrors.Invalid.WithReason("InvalidTOTPSecret")
Functions ¶
func TranslateTOTPError ¶
Types ¶
type Provider ¶
type Provider struct { Store *Store Config *config.AuthenticatorTOTPConfig Clock clock.Clock }
func (*Provider) Authenticate ¶
func (p *Provider) Authenticate(a *authenticator.TOTP, code string) error
type Store ¶
type Store struct { SQLBuilder *appdb.SQLBuilderApp SQLExecutor *appdb.SQLExecutor }
Click to show internal directories.
Click to hide internal directories.