oob

package
v0.0.0-...-2b8ec9a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(Store), "*"),
	wire.Struct(new(Provider), "*"),
	wire.Struct(new(CodeSender), "*"),
)

Functions

This section is empty.

Types

type CodeSender

type CodeSender struct {
	OTPMessageSender OTPMessageSender
}

func (*CodeSender) SendCode

func (s *CodeSender) SendCode(
	channel model.AuthenticatorOOBChannel,
	target string,
	code string,
	messageType otp.MessageType,
) (err error)

type OTPMessageSender

type OTPMessageSender interface {
	SendEmail(email string, opts otp.SendOptions) error
	SendSMS(phone string, opts otp.SendOptions) error
}

type Provider

type Provider struct {
	Store *Store
	Clock clock.Clock
}

func (*Provider) Create

func (p *Provider) Create(a *authenticator.OOBOTP) error

func (*Provider) Delete

func (p *Provider) Delete(a *authenticator.OOBOTP) error

func (*Provider) Get

func (p *Provider) Get(userID string, id string) (*authenticator.OOBOTP, error)

func (*Provider) GetMany

func (p *Provider) GetMany(ids []string) ([]*authenticator.OOBOTP, error)

func (*Provider) List

func (p *Provider) List(userID string) ([]*authenticator.OOBOTP, error)

func (*Provider) New

func (p *Provider) New(id string, userID string, oobAuthenticatorType model.AuthenticatorType, target string, isDefault bool, kind string) *authenticator.OOBOTP

type Store

type Store struct {
	SQLBuilder  *appdb.SQLBuilderApp
	SQLExecutor *appdb.SQLExecutor
}

func (*Store) Create

func (s *Store) Create(a *authenticator.OOBOTP) (err error)

func (*Store) Delete

func (s *Store) Delete(id string) error

func (*Store) Get

func (s *Store) Get(userID string, id string) (*authenticator.OOBOTP, error)

func (*Store) GetMany

func (s *Store) GetMany(ids []string) ([]*authenticator.OOBOTP, error)

func (*Store) List

func (s *Store) List(userID string) ([]*authenticator.OOBOTP, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL