Documentation ¶
Index ¶
- Variables
- func TranslateTOTPError(err error) error
- type Provider
- func (p *Provider) Authenticate(a *authenticator.TOTP, code string) error
- func (p *Provider) Create(ctx context.Context, a *authenticator.TOTP) error
- func (p *Provider) Delete(ctx context.Context, a *authenticator.TOTP) error
- func (p *Provider) Get(ctx context.Context, userID string, id string) (*authenticator.TOTP, error)
- func (p *Provider) GetMany(ctx context.Context, ids []string) ([]*authenticator.TOTP, error)
- func (p *Provider) List(ctx context.Context, 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(ctx context.Context, a *authenticator.TOTP) (err error)
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) Get(ctx context.Context, userID string, id string) (*authenticator.TOTP, error)
- func (s *Store) GetMany(ctx context.Context, ids []string) ([]*authenticator.TOTP, error)
- func (s *Store) List(ctx context.Context, 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
Click to show internal directories.
Click to hide internal directories.